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

Reply via email to