Hi List,
  Let us assume there are 10 results for a Query. If I want to abort the
Query after 5 results How can I do that? What notification I will get once I
got all the results and of if there are any errors after 6th result.

How to specify a primary Key, foreign key while creating a table.

Thanks and Regards,
 Vivek R


At the present time, sqlite hadn't implemented syntax such as LIMIT 0,5. So you have to do it manually. It's fairly easy if you use prepared statements. The steps are as follows:

1. Call sqlite3_prepare with your query string
2. Call sqlite3_bind_* to bind parameters if applicable
3. Call sqlite3_step and sqlite3_column_* to fetch results and keep count, since sqlite3_step only returns one row at a time, you can decide from its return values, if it's SQLITE_DONE, there's probably less than 5 results, if it's still SQLITE_ROW when your counter reaches 5, you break the while loop. 4. Call sqlite3_reset or sqlite3_finalize, and yes you can reset or finalize a query when it's not done.

Best regards,
He Shiming

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to