chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] Re: sqlite3 and "drop table if exists"


From: Thomas Chust
Subject: [Chicken-users] Re: sqlite3 and "drop table if exists"
Date: Fri, 17 Feb 2006 02:04:01 +0000 (GMT)

On Thu, 16 Feb 2006, Zbigniew wrote:

Thomas, I ran into some odd behaviour while using the sqlite3 egg. It seems that executing the SQL statement "DROP TABLE IF EXISTS" throws an error when the table does not exist. The same is true for "CREATE TABLE IF NOT EXISTS". Apparently, sqlite3_step is returning the error code for "misuse", although the error message reported is "not an error" (basically an impossible "error 0" message). [...]

Hello,

currently I cannot reproduce this problem. "DROP TABLE IF EXISTS" and "CREATE TABLE IF NOT EXISTS" both don't exist in the version of SQLite3 on my machine, which is slightly older. But I'm a bit reluctant to update, because it is part of the standard MacOS X distribution and used by a few programs. It may even contain some Apple specific patches, so I'll have to be really careful not to break half of my system when updating. For such operations it's too late at night now ;)

Although I will try to look into this again, you may want to create a workaround for your problem in the meantime. I would suggest to explicitly check the sqlite_master table for the presence of the table in question with a query like
   SELECT count(name) FROM sqlite_master
    WHERE type = 'table' AND name = 'my_table';

This would also be backwards compatible with my antique SQLite3 library ;)

Concerning your other problem with large integers, I uploaded a new fixed version of the sqlite3 egg to my website:
   http://www.chust.org/projects/sqlite3.html
   http://www.chust.org/projects/sqlite3.egg

cu,
Thomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]