views:

37

answers:

1

sqlite3 *insert_statement=nil;

if (insert_statement == nil) {

    static char *query = "INSERT INTO iteminfo (itemname, friendid) VALUES(?,?) where itemid=?";

    if (sqlite3_prepare_v2(database, query, -1, &insert_statement, NULL) != SQLITE_OK) {
        NSAssert1(0, @"Error: failed to prepare statement with message '%s'.", sqlite3_errmsg(database));
    }

hii... I am new to Objective C ...

i m trying this code to insert some values in database but there is a exception in preparing insert statement plz help me is there something i am missing ... Thanks in advance...

A: 

Do you have those question marks in the query string in the code. I guess you should have some real values instead of them in VALUES(?, ?) WHERE itemid=? part.

artem_dan
yes every thing is inside the query string and i don't hav any real values... plz give some other suggesstion this issue causing my app to crash
mayank sahai