Thank you very much for the writing!
Unfortunately, i've found that i not only need to fix the SQLite 2.8 dump
callback routine (i did it already for my database), but rather make the
SQLite 3 backward compatible. The reason is that i have a lot of scripts
from SQLite 2.8, for example database backups, and i need these scripts to
run correctly on SQLite 3.
Is there any quick hack allowing me to change SQLite 3 and make it to look
at the column definition to determine type of a data value when processing
INSERT statements (like the SQLite 2.8 does)?
Many thanks,
Sergey Tarasov.
----- Original Message -----
From: "Downey, Shawn" <[EMAIL PROTECTED]>
To: <sqlite-users@sqlite.org>
Sent: Wednesday, July 20, 2005 6:03 PM
Subject: RE: [sqlite] SQLite 3 manifest typing question
Thank you for your response.
Unfortunately for you, I believe that most peoples response would be,
either use 3.x...
This is not an option. Importing with 3.x does not solve this problem.
Although I think 3.x it could be modified to retain the leading zeros
depending on the field type (e.g., for non-INTEGER types), it is
probably best to fix the 2.x .dump command to add single quotes rather
than change the 3.x .read command.
... or fix the .dump command yourself in sqlite 2.8.
I was certainly considering doing this. All I wanted was confirmation
that was indeed unintended behavior. I thought retaining leading zeros
may have been addressed some other way. Such as with a pragma?
I was also concerned that there may be other negative consequences of
putting single quotes around integers in an insert command. Can anyone
think of any problems this could cause?
Thanks.
Shawn M. Downey
MPR Associates
632 Plank Road, Suite 110
Clifton Park, NY 12065
518-371-3983 x3 (work)
860-508-5015 (cell)
-----Original Message-----
From: John LeSueur [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 20, 2005 10:50 AM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] SQLite 3 manifest typing question
3. Now i dump my SQLite 2.8. database using .dump command and got
following
script:
BEGIN TRANSACTION;
create table codes(code TEXT);
INSERT INTO codes VALUES(00);
INSERT INTO codes VALUES(011);
COMMIT;
4. It works great when recreating the SQLite 2.8 database, but when
run on
This looks like a bug in sqlite 2.8. First, the dump command should use
single quotes for those values.
Second, sqlite 2.8 should treat them as numbers when inserting(since
they are not string literals).
Unfortunately for you, I believe that most peoples response would be,
either use 3.x or fix the .dump
command yourself in sqlite 2.8. I wouldn't think it would be that hard.
In fact, you could just change
the dump command to quote all the values unconditionally, and everything
would still work.
John LeSueur