[DB-SIG] Re: cx_Oracle - passing unnecessary bind variables

Dieter Maurer dieter at handshake.de
Mon Nov 24 13:00:39 EST 2003


Anthony Tuininga wrote at 2003-11-24 08:22 -0700:
 > ...
 > Since cx_Oracle allows keyword arguments for executing SQL statements,
 > this one has not proved to be a problem to me. This is something that I
 > wish the DB API standard would "officially" endorse. Specifically, this
 > is permitted in cx_Oracle:
 > 
 > cursor.execute(sql, var1=value1, var2=value2, var3=value3....)
 > 
 > which allows for the building of a dictionary quite easily. There are a
 > few cases where it might be convenient to pass a prebuilt dictionary but
 > they are few and far between -- unless you can give me some additional
 > examples??

That is no longer an issue:

  When you have a dictionary "d" and you need keyword arguments,
  you simply pass "**d", e.g.:

      cursor.execute(sql, **d)


-- 
Dieter



More information about the DB-SIG mailing list