On Thu, Dec 18, 2008 at 11:31 AM, wrote:
> From: "Sidharth Kuruvila"
>
> Do this instead
>
> cur.execute('select * from Employee where id in (%s)', ids.join(', '));
>
>
I would need to co-erce my id into a string rep to do this. I guess that's
ok?
Also, will the escaping be taken care of if the
On Thu, Dec 18, 2008 at 11:31 AM, wrote:
> From: Jeff Rush
> You may find the bit of additional software at the following site useful.
> It
> has a slide presentation that talks about this and similar issues and
> delivers
> a lightweight solution.
>
>http://furius.ca/antiorm/
>
> The prese
Vijay Ramachandran wrote:
>
> Suppose I have a list of ids, I would write sql such as
> 'select * from Employee where id in (id1, id2, id3)' and this would work
> even if there was only one id, say, 'select * from Employee where id in
> (id1)'
>
> How should I do this in MySQLdb? It seems that I
Do this instead
cur.execute('select * from Employee where id in (%s)', ids.join(', '));
On Wed, Dec 17, 2008 at 5:13 PM, Vijay Ramachandran wrote:
> Hello.
>
> I'm unable to figure out how to use mysqldb (actually, dbabi) to write an
> "in" query.
>
> For instance, suppose my table looks like th
Hello.
I'm unable to figure out how to use mysqldb (actually, dbabi) to write an
"in" query.
For instance, suppose my table looks like this:
Employee(
id int not null primary key,
name varchar(32) not null)
);
Suppose I have a list of ids, I would write sql such as
'select * from Employee wher