Re: Raw SQL parameters

2009-01-20 Thread Malcolm Tredinnick
On Tue, 2009-01-20 at 11:19 -0800, Ian wrote: > On Jan 19, 5:20 pm, Malcolm Tredinnick > wrote: > > Just to be accurate, PEP 249 says that a paramstyle of "pyformat" is one > > possible value, which would permit the above sort of query. It does not > > say that every

Re: Raw SQL parameters

2009-01-20 Thread Ian
On Jan 19, 5:20 pm, Malcolm Tredinnick wrote: > Just to be accurate, PEP 249 says that a paramstyle of "pyformat" is one > possible value, which would permit the above sort of query. It does not > say that every conforming database wrapper is required to support it. >

Re: Raw SQL parameters

2009-01-19 Thread Malcolm Tredinnick
On Mon, 2009-01-19 at 17:49 +0100, Matias Surdi wrote: > Hi, > > > I'm trying to run a sql query with parameters taken from a dict, here is > the relevant part of the code: > query = "select * from table where name='%(name)s'" > parameters = {'name':'valueofname'} > cursor

Re: Raw SQL parameters

2009-01-19 Thread Matias Surdi
Karen Tracey escribió: > On Mon, Jan 19, 2009 at 2:06 PM, Matias Surdi > wrote: > > Yes, maybe it's just a problem with sqlite, which is te backend I'm > using.I'll try with mysql later. > > Is this a bug? should it be reported

Re: Raw SQL parameters

2009-01-19 Thread Karen Tracey
On Mon, Jan 19, 2009 at 2:06 PM, Matias Surdi wrote: > Yes, maybe it's just a problem with sqlite, which is te backend I'm > using.I'll try with mysql later. > > Is this a bug? should it be reported as a ticket? > I see you opened ticket #10070, which is fine because I

Re: Raw SQL parameters

2009-01-19 Thread Matias Surdi
Karen Tracey escribió: > On Mon, Jan 19, 2009 at 12:40 PM, Ramiro Morales > wrote: > > > On Mon, Jan 19, 2009 at 3:15 PM, Matias Surdi > wrote: > > > > The curious thing here,

Re: Raw SQL parameters

2009-01-19 Thread Ramiro Morales
On Mon, Jan 19, 2009 at 3:56 PM, Karen Tracey wrote: > > That's using MySQL as the DB, so perhaps it is backend-specific? So it seems. the MySQL and PostgreSQL backend seem to (still?) support it. But the Oracle crew removed it a while back:

Re: Raw SQL parameters

2009-01-19 Thread Karen Tracey
On Mon, Jan 19, 2009 at 12:40 PM, Ramiro Morales wrote: > > On Mon, Jan 19, 2009 at 3:15 PM, Matias Surdi > wrote: > > > > The curious thing here, is that the above query works perfect running it > > directly through sqlite3. > > > > From what I have

Re: Raw SQL parameters

2009-01-19 Thread Ramiro Morales
On Mon, Jan 19, 2009 at 3:15 PM, Matias Surdi wrote: > > The curious thing here, is that the above query works perfect running it > directly through sqlite3. > >From what I have seen by reading DB backend source code, Django cursor's execute() method supports only the

Re: Raw SQL parameters

2009-01-19 Thread Matias Surdi
Karen Tracey escribió: > On Mon, Jan 19, 2009 at 11:49 AM, Matias Surdi > wrote: > > > Hi, > > > I'm trying to run a sql query with parameters taken from a dict, here is > the relevant part of the code: >query =

Re: Raw SQL parameters

2009-01-19 Thread Karen Tracey
On Mon, Jan 19, 2009 at 11:49 AM, Matias Surdi wrote: > > Hi, > > > I'm trying to run a sql query with parameters taken from a dict, here is > the relevant part of the code: >query = "select * from table where name='%(name)s'" Remove the single quotes around

Raw SQL parameters

2009-01-19 Thread Matias Surdi
Hi, I'm trying to run a sql query with parameters taken from a dict, here is the relevant part of the code: query = "select * from table where name='%(name)s'" parameters = {'name':'valueofname'} cursor = connection.cursor() data =