Python sample code for PLSQL REF CURSORS
Collapse
This topic is closed.
X
X
-
A.MTags: None -
Gerhard Häring
Re: Python sample code for PLSQL REF CURSORS
A.M wrote:[color=blue]
> Hi,
>
> I am having hard time to find a sample that shows me how to return an OUT
> REF CURSOR from my oracle stored procedure to my python program. [...][/color]
import cx_Oracle
con = cx_Oracle.conne ct("me/secret@tns")
cur = con.cursor()
outcur = con.cursor()
cur.execute("""
BEGIN
MyPkg.MyProc(:c ur);
END;""", cur=outcur)
for row in out_cur:
print row
HTH,
-- Gerhard
-
A.M
Re: Python sample code for PLSQL REF CURSORS
Exactly what I was looking for.
Thanks alot
"Gerhard Häring" <gh@ghaering.de > wrote in message
news:mailman.53 32.1146751430.2 7775.python-list@python.org ...[color=blue]
> A.M wrote:[color=green]
>> Hi,
>>
>> I am having hard time to find a sample that shows me how to return an OUT
>> REF CURSOR from my oracle stored procedure to my python program. [...][/color]
>
> import cx_Oracle
>
> con = cx_Oracle.conne ct("me/secret@tns")
> cur = con.cursor()
> outcur = con.cursor()
> cur.execute("""
> BEGIN
> MyPkg.MyProc(:c ur);
> END;""", cur=outcur)
>
> for row in out_cur:
> print row
>
> HTH,
>
> -- Gerhard[/color]
Comment
Comment