Re: [DB-SIG] trouble with list formatting

2007-06-06 Thread Carsten Haese
On Wed, 2007-06-06 at 20:55 +0200, Dieter Maurer wrote: > >As Marc-Andre pointed out, parameter binding is only for > >scalar values. > > Then it must raise an exception but not behave inconsistently (such > as adding a ',' for one element lists but not adding a comma for lists > with more than 1

Re: [DB-SIG] trouble with list formatting

2007-06-06 Thread Dieter Maurer
Carsten Haese wrote at 2007-6-5 13:40 -0400: >On Tue, 2007-06-05 at 19:21 +0200, Dieter Maurer wrote: >> Roger Doger wrote at 2007-6-4 09:46 -0500: >> >The following use of the API with MySQL works fine >> > >> >> items = [1, 2] >> >> execute('SELECT * from table1 WHERE field1 IN %s', (items,)) >>

Re: [DB-SIG] trouble with list formatting

2007-06-05 Thread Carsten Haese
On Tue, 2007-06-05 at 19:21 +0200, Dieter Maurer wrote: > Roger Doger wrote at 2007-6-4 09:46 -0500: > >The following use of the API with MySQL works fine > > > >> items = [1, 2] > >> execute('SELECT * from table1 WHERE field1 IN %s', (items,)) > >resultant query string: SELECT * from table1 WHERE

Re: [DB-SIG] trouble with list formatting

2007-06-05 Thread Dieter Maurer
Roger Doger wrote at 2007-6-4 09:46 -0500: >The following use of the API with MySQL works fine > >> items = [1, 2] >> execute('SELECT * from table1 WHERE field1 IN %s', (items,)) >resultant query string: SELECT * from table1 WHERE field1 IN ('1', '2') > >By contrast, the following yields the messag

Re: [DB-SIG] trouble with list formatting

2007-06-05 Thread M.-A. Lemburg
On 2007-06-04 16:46, Roger Doger wrote: > The following use of the API with MySQL works fine > >> items = [1, 2] >> execute('SELECT * from table1 WHERE field1 IN %s', (items,)) > resultant query string: SELECT * from table1 WHERE field1 IN ('1', '2') > > By contrast, the following yields the mess

[DB-SIG] trouble with list formatting

2007-06-04 Thread Roger Doger
The following use of the API with MySQL works fine > items = [1, 2] > execute('SELECT * from table1 WHERE field1 IN %s', (items,)) resultant query string: SELECT * from table1 WHERE field1 IN ('1', '2') By contrast, the following yields the message "error in your SQL syntax" > items = [1] > exec