"Preston Zaugg" <[EMAIL PROTECTED]> wrote:
> I have some updates to the schema of my sqlite database that i am trying to > apply. When i run these statements from the command line util they run fine.
> when i run them from the API I get a SQLITE_ERROR on the statement that
> drops a table. These statements are selected out of an attached database and
> executed against the default database.
>
> The code runs the following statements:
> 1 drop views (send in all "drop view" statements at once)
> 2 drop table (statement text: "DROP TABLE Specific_Product;")
> 3 create new table and insert seed data (this step is repeated for multiple
> tables)
> 4 create new view (repeated for multiple views)
>
> step 2 returns a SQLITE_ERROR, but the other statements that don't rely on
> the table being dropped run fine if i ignore the error.
>

This is probably an SQLITE_SCHEMA error.  Rerun sqlite3_prepare() and
sqlite3_step() and it should work the second time.

This particular SQLITE_SCHEMA error seems unnecessary though.  Looks
like sqlite3_step() could probably do a better job of preventing it.
I'll have a look and see what I can find....
--
D. Richard Hipp <[EMAIL PROTECTED]>


It actually seems to be returning the SQLITE_ERROR code (1) with the message "SQL logic error or missing database". I re-ordered my statements for a quick test and had the drop statement run first and i still get the error. I tried to create a dummy table with just one dummy row to see if it was something about this table, but that drop statement would run either.

Could it have something to do with the fact that i have a second database attached?


Reply via email to