SQL: don't use bind variables (was Re: Using strings with ' in them in SQL-queries)

D'Arcy J.M. Cain darcy at vex.net
Fri Jun 2 08:28:47 EDT 2000


Paul Boddie <paulb at infercor.no> wrote:
>   db.execute("insert into test (id, name) value (1, :var)", {"var" : var})

> (Now I look again, I don't know where the 'query' method came from, but I assume
> that the thread's initiator meant 'execute'.)

He's probably using PyGreSQL which has two distinct interfaces, PyGreSQL
Classic (or PyGres) and PyGreSQL DB-API which is in the 3.0 version
just released.  He is using the classic interface which, btw, I am not
planning to deprecate.  Both will continue to be available in PyGreSQL
as long as I am maintaining it.

There's-more-than-one-way-to-skin-a-dead-parrot-ly y'rs

-- 
D'Arcy J.M. Cain <darcy at vex.net>           |  Democracy is three wolves
http://www.vex.net/                        |  and a sheep voting on         
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.



More information about the Python-list mailing list