--- On Tue, 8/11/09, Radcon Entec <radconen...@yahoo.com> wrote:

> From: Radcon Entec <radconen...@yahoo.com>
> Subject: [sqlite] Cannot insert records into a table after dropping and 
> recreating it
> To: sqlite-users@sqlite.org
> Date: Tuesday, August 11, 2009, 10:50 AM
> Greetings!
> 
> I have an application that uses an SQLite database file
> that may or may not exist when the application starts. 
> At startup, the application creates three tables.  If
> the file previously existed, the create table queries
> fail.  My code checks the error message, and if it
> indicates that the table previously existed, it ignores the
> error.  
> 
> There is a fourth table that is handled differently. 
> This table will be created at startup, used, and then
> dropped.  So, my code drops the table, then creates it,
> and then adds data to it.  (The final drop is not yet
> implemented.)  Just in case the table got left behind
> for some reason, my code drops the table before creating
> it.  Any errors from the drop are ignored, although
> there is an exception handler there and I have verified that
> the hander is not being executed.
> 
> If the database did not exist before the application runs,
> the temporary table is created and populated as
> expected.  But if the database did exist before the
> application runs, the temporary table is dropped and created
> as expected, but I cannot write any data into it. 
> There are no errors generated, but there is no data in the
> table, either.  
> 
> I am inserting data into the table by building an insert
> query and calling sqlite3_exec().  
> 
> Am I leaving out a step that makes my newly created table
> unwritable?
> 
> Thanks very much!
> 
> RolbR
> 
> 

Have you verified that your drop and recreate isn't being called again (maybe 
after doing the inserts)???

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to