Stephen Sutherland wrote:
okay i'm trying to use preparestatement and step and finalize. I have some quick questions about this legacy.c code. First I notice that it has a while loop within a while loop. Question: when I implement this prepared statement, will I also need a while loop within a while loop ? Just double checking I noticed rc = sqlite3_step(pStmt); is the start of the inner while loop. I'm guessing the inner while loop is needed with pStmt contains multiple SQl statements right ?
Stephen,
The two loops are used, as you surmised, to execute multiple SQL statements. The outer loop is repeated for each SQL statement in the input to sqlite3_exec. The inner loop is used to step through each row of the result of the execution of a particular statement.
In the normal case, with only a single SQL statement passed in, the outer loop is executed only once. The inner loop will be executed once for each result row.
HTH Dennis Cote ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------

