iphone - Why I am getting sqlite3error? -
I am trying to reuse a sqlite statement in my application in a method. Here is the relevant code
if (ifets_statement == zero) {const char * sql = "select different numbers, mytable WHERE rolls from cls and like divname?"; If (sqlite3_prepare_v2 (database, sql, -1, and wkets_statement, tap)! = SQLITE_OK) {NSAssert1 (0, @ "error: message failed with stmt '% s', sqlite3_errmsg (database)); }} Sqlite3_bind_text (getsets_statement, 1, [cls UTF8 string], -1, SQLITE_TRANSIENT); Sqlite3_bind_text (getsets_statement, 2, [divname UTF8String], -1, SQLITE_TRANSIENT); while (sqlite3_step (getsets_statement) == SQLITE_ROW) {setNumber = Sqlite3_column_int (getsets_statement, 0); roll = sqlite3_column_int (getsets_statement, 1); [NumArr addObject: [NSNumber NumberAssociation: SETNumber]]; [Roller Aid Object: [NSNumber NumberAttah: Roll]];} Sqlite3_reset (getsets_statement);sqlite3errordivnameand < The values of code> cls are present (oneNSLogwas checked and checked), but I do not understand why I am getting this error, let me first call itThe error is found on the bind_textstatement.This is in the gdb console
Program received signal: "EXC_BAD_ACCESS" (GDB) where # 090907857f in sqlite3Error () # 1 0x9041 via vdbeUnbind () # Bind Text (0) in 0x9041b2c8 Any help?
Be sure there is no other problem (whether the database is being closed elsewhere ? Does
getsets_statementpoint to the same object, has it been finalized?). Then try using NULL or SQLITE___STATIC instead of SQLITE_TRANSIENT as it returns data from[NSString UTF8String](which you do not need), it does not explicitly require a destructor, And it will remain valid when your function will exit, at that time you are in any way running the statement.
Comments
Post a Comment