[DB-SIG] DCOracle - prepare samples needed.

Eric Brunson brunson@level3.net
Fri, 14 Jul 2000 12:57:24 -0600


It's pretty simple with DCOracle.

Assuming a valid connection object named 'dbc':

h = dbc.prepare( sql )

# a handle always takes a tuple of positional parameters
h.execute( ( 1, ) )

# Now it acts just like a cursor object
for ( name, ) in h.fetchall():
    print name


e.

* Luiz Tadao Honda (lhonda@zip.net) [000621 09:30]:
> Hi,
> 
> I trying to prepare a query with input parameters like:
> 
> sql='select name from user where id=:p1'
> 
> to let Oracle make the execution plan only once and then substitute the
> variable p1 with the real values.
> Does anyone have some samples to help me?
> 
> Thanks.
> 
> Regards
> 
> Luiz Honda
> 
> 
> 
> 
> _______________________________________________
> DB-SIG maillist  -  DB-SIG@python.org
> http://www.python.org/mailman/listinfo/db-sig


-- 
Eric Brunson - brunson@level3.net - page-eric@level3.net  

"When governments fear the people there is liberty. When the people
fear the government there is tyranny." - Thomas Jefferson