Re: [sqlite] inserting a number as a string and keeping it that way

2009-09-27 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Sean Moss-Pultz wrote: > OK. Then I'm going to need to escape this string since the insert is > really coming from a import of a huge datadump generated in Python. You should probably explain the big picture first. Python has at least two wrappers

Re: [sqlite] inserting a number as a string and keeping it that way

2009-09-27 Thread Sean Moss-Pultz
Hi Roger Thanks a lot for such a quick reply... On Sun, Sep 27, 2009 at 3:18 PM, Roger Binns wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Sean Moss-Pultz wrote: >> How can I get the string to stay 0123? > > It isn't a string - you supplied an integer and

Re: [sqlite] inserting a number as a string and keeping it that way

2009-09-27 Thread Dan Bishop
Sean Moss-Pultz wrote: > Hi List > > Here's basically what I'm doing: > > sqlite> create table test(t text); > sqlite> insert into test values(0123); > sqlite> select * from test; > 123 > > How can I get the string to stay 0123? I've read the docs about > "Column Affinity." But I guess I'm

Re: [sqlite] inserting a number as a string and keeping it that way

2009-09-27 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Sean Moss-Pultz wrote: > How can I get the string to stay 0123? It isn't a string - you supplied an integer and SQLite treated it that way and then stored it. If you really wanted a string then you must quote it (remember to use single quotes). If

[sqlite] inserting a number as a string and keeping it that way

2009-09-27 Thread Sean Moss-Pultz
Hi List Here's basically what I'm doing: sqlite> create table test(t text); sqlite> insert into test values(0123); sqlite> select * from test; 123 How can I get the string to stay 0123? I've read the docs about "Column Affinity." But I guess I'm not smart enough to figure this out :-)