views:

266

answers:

1

I'm using a few sqlite3_bind routines (in the iPhone SDK) as shown below to make a single update (INSERT or UPDATE) to a table:

        sqlite3_bind_text(update_statement, 1, aString, -1, SQLITE_TRANSIENT);
        sqlite3_bind_int(update_statement, 2, anInteger);
        sqlite3_bind_int(update_statement, 3, pk);

However, upon checking the updated table I discover unexpected results. I followed the progress using 'step over' in the Xcode Debugger and it looks like this group of three sqlite3_bind routines is being looped over so as to execute MORE THAN ONCE and I'm getting multiple inserts or updates when there should only be one. This routine is not inside of a while statement or anything so I'm puzzled.

Hope a person familiar with sqlite3 in the iPhone SDK can help.

A: 

Oops....It might help if the method containing the sqlite3_bind was not being called redundantly by another function elsewhere simultaneously LOL. I created a separate call to the function with the sqlite3_bind routines and completely neglected to delete the original call. Dumb mistake, solved: sqlite3_bind does not LOOP.

RexOnRoids