On Nov 29, 10:49 pm, "D'Arcy J.M. Cain" wrote:
> On Mon, 29 Nov 2010 19:11:18 + (UTC)
>
> Tim Harig wrote:
> > > INSERT INTO foo (name) VALUES ('xxx')
>
> > > That's the standard SQL way.
>
> > Yes, it works; but, the OP asked specifically to be able to enter all of
> > the field values, in
On 2010-11-29, D'Arcy J.M. Cain wrote:
> On Mon, 29 Nov 2010 19:11:18 + (UTC)
> Tim Harig wrote:
>> > INSERT INTO foo (name) VALUES ('xxx')
>> >
>> > That's the standard SQL way.
>>
>> Yes, it works; but, the OP asked specifically to be able to enter all of
>> the field values, including t
On Mon, 29 Nov 2010 19:11:18 + (UTC)
Tim Harig wrote:
> > INSERT INTO foo (name) VALUES ('xxx')
> >
> > That's the standard SQL way.
>
> Yes, it works; but, the OP asked specifically to be able to enter all of
> the field values, including the autoincrement field.
You're right, I missed th
On 11/29/2010 1:12 PM, tinauser wrote:
Dear List
I'm writing an application that has to create and populate an SQLite
database.
I'm doing pretty well, but now I'm facing a problem I can not solve.
I create a table with a primary key autoincrement, something like
sqlcmd="CREATE TABLE foo (id INT
On Nov 29, 7:28 pm, Tim Harig wrote:
> On 2010-11-29, tinauser wrote:
>
> > '''
> > INSERT INTO 'foo' VALUES (?,?)
> > '''
> > ,('NULL','yyy'))
>
> s/'NULL'/None/
>
> > I get a datatype mismatch error.
>
> The sqlite module is smart enough to convert between Python types and
> Sqlite types. If y
On 2010-11-29, D'Arcy J.M. Cain wrote:
> On Mon, 29 Nov 2010 13:19:19 -0500
> Mel wrote:
>> tinauser wrote:
>> '''INSERT INTO foo VALUES (NULL, ?)'''
>
> Does this work in SQLite:
>
> INSERT INTO foo (name) VALUES ('xxx')
>
> That's the standard SQL way.
Yes, it works; but, the OP asked specif
On Mon, 29 Nov 2010 13:19:19 -0500
Mel wrote:
> tinauser wrote:
> '''INSERT INTO foo VALUES (NULL, ?)'''
Does this work in SQLite:
INSERT INTO foo (name) VALUES ('xxx')
That's the standard SQL way.
--
D'Arcy J.M. Cain | Democracy is three wolves
http://www.druid.net/darcy/
On 2010-11-29, tinauser wrote:
> '''
> INSERT INTO 'foo' VALUES (?,?)
> '''
> ,('NULL','yyy'))
s/'NULL'/None/
> I get a datatype mismatch error.
The sqlite module is smart enough to convert between Python types and
Sqlite types. If you pass it 'NULL' it thinks you are passing it a string.
Pyth
tinauser writes:
> however, if in python i try to execute a script like:
>
> cur.execute(
> '''
> INSERT INTO 'foo' VALUES (?,?)
> '''
> ,('NULL','yyy'))
,(None, 'yyy'))
Or use VALUES(NULL, ?)
as suggested in another post.
--
John Bokma
tinauser wrote:
> Normally, the sqlite command that works would be
>
> INSERT INTO 'foo' VALUES (NULL, 'yyy' )
>
> however, if in python i try to execute a script like:
>
> cur.execute(
> '''
> INSERT INTO 'foo' VALUES (?,?)
> '''
> ,('NULL','yyy'))
>
> I get a datatype mismatch error.
>
> Ha
Dear List
I'm writing an application that has to create and populate an SQLite
database.
I'm doing pretty well, but now I'm facing a problem I can not solve.
I create a table with a primary key autoincrement, something like
sqlcmd="CREATE TABLE foo (id INTEGER PRIMARY KEY AUTOINCREMENT, name
TEXT
11 matches
Mail list logo