[PYTHON DB-SIG] RE: Looking for examples of oracledb usage
Mon, 21 Apr 1997 18:02:20 -0700
The bind variables are numbered using 1-based values. As I recall, there
is no limit to the number of bind variables you may specify, but Jim
Fulton would be the expert here for the oracledb module.
My advice: try it and see :-)
From: Harold Poskanzer [SMTP:email@example.com]
Sent: Monday, April 21, 1997 3:26 PM
Subject: Re: [PYTHON DB-SIG] RE: Looking for examples of
Would you believe I was wondering what the oracledbmodule bind
was the night before I got this email?
I have one question, though: I assume I can do :0 through :9
easily, but how
do I do more than 10 bind variables?
Harold Poskanzer Software
2620 Augustine Dr #250 Phone:
Santa Clara, CA 95054
Proof of Intelligent Life on the Net
> The :N syntax uses database facilities for "binding" the
> values to the SQL statement, while the form you mention is
> altering the SQL statement that gets sent to the database.
> several benefits to using parameter binding:
> 1) you don't need to worry about escaping string values
> 2) certain types of values *can't* be specified in the SQL
> statement (typically, LONG/BLOB/IMAGE.. whatever you want to
> 3) you can actually achieve higher efficiencies using
> binding. The standard sequence of operations with a database
> the statement, bind parameters, execute the statement, fetch
> results. With parameter binding, you can fill in values to the
> memory and re-execute the statement (skipping the parse/bind
> altering the SQL string, you have to go through all the steps
> parse step is surprisingly expensive!
> You will see the use of "?" in some database interfaces rather
> :N syntax (which comes from Oracle, actually). The :N variety
> because binding positionally is quite handy in a variety of
> I hope that clears things up!
> -----Original Message-----
> From: Daniel Larsson
> Sent: Thursday, April 17, 1997 1:17 PM
> To: firstname.lastname@example.org
> Subject: Re: Looking for examples of oracledb
> Anthony Baxter wrote in article
> >something like
> >curs.execute("select * from db where blah = :1 and foo
> >works for me.
> In general, how does this differ from using the standard
string formatting, e.g.
> curs.execute("select * from db where blah = %d and foo =
%d" % (123, 456))
> (I assume these examples are equivalent, but I'm asking
for the general
> >>>> Roy Smith wrote
> >> I'm looking for example of python code that uses the
> >> I've got simple stuff working, but havn't yet figured
out how to do
> >> variable binding in an execute call. The
documentation says, "Variables
> >> are specified in a database-specific notation that is
based on the index
> >> in the parameter tuple (position-based rather than
name-based)", but I'm
> >> not quite sure what all that means.
DB-SIG - SIG on Tabular Databases in Python
send messages to: email@example.com
administrivia to: firstname.lastname@example.org