Perhaps you could look at the code in shell.c and see how it does the .dump, then copy paste or something similar into your own app. I'm not sure if there might be issues with functions declared SQLITE_API vs SQLITE_INTERNAL, which may require some additional working around, but hopefully not.
-----Original Message----- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon Slavin Sent: Monday, June 27, 2011 8:06 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] How to recover the SQLITE_CORRUPT error in C programming ? On 27 Jun 2011, at 9:15am, baiydavid wrote: > when an SQLITE_CORRUPT error is returned, we can use ".dump" command to exports the data into a sql script, and then exec this sql in a new database, > But how to dump the data into a sql script with C programming Interface? Is there any other better method to solve this problem? Sorry, David, but there is no built-in way to dump a SQLite database as SQL commands. If you need to worry about this, this suggests you are getting corrupt databases very often. This should not happen: SQLite should not be corrupting its databases. Perhaps you could investigate this problem with your setup. Simon. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users