g...@novadsp.com wrote: > "INSERT INTO table (columns) VALUES(?,?,?,?); SELECT last_insert_rowid() > FROM table;" > > which works in the Sqlite3 console. However when I run this > sqlite3_step() returns SQLITE_DONE. > > sqlite3_prepare(); > sqlite3_bind_xxx(); > sqlite3_step(); > > Can anyone point out what I am missing?
sqlite3_prepare only accepts one statement, and (optionally) gives you a pointer to the beginning of the next one. This way, if you have a string with multiple statements in it, you can prepare and execute them one by one - which is exactly what SQLite shell is doing. -- Igor Tandetnik _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users