problem with sqlite3_prepare_v2

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • problem with sqlite3_prepare_v2

    Hi all,

    i am really new to cocoa. My Problem is:

    i read from an sqltable an string including another sql-statement moving it into an NSString initWithUTF8. Later i want to send this statement to the database through sqlite3_prepare_v2

    the sql looks like this:

    SELECT
    co.idContactID,
    co.sLastName + ', ' + co.sFirstName + CASE WHEN CHARINDEX('Dr.', sSuffix) > 0 THEN ', ' + sSuffix ELSE '' END AS sContactName,
    cu.sName AS sCustomerName
    FROM
    maContacts AS co
    LEFT OUTER JOIN
    maCustomers AS cu
    ON
    co.idCustomerID = cu.idCustomerID
    ORDER BY
    co.sLastname, co.sFirstname



    i get an error on preparing because there are linefeed and c-style escapes like \n and \' and \t

    is there any solution for encoding the string differently? i tried to remove \n by my own, that helps but there is still \' to remove. And there should be a more elegant solution.

    thank for response