Python sample code for PLSQL REF CURSORS

?

=?ISO-8859-1?Q?Gerhard_H=E4ring?=

A.M said:
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. [...]

import cx_Oracle

con = cx_Oracle.connect("me/secret@tns")
cur = con.cursor()
outcur = con.cursor()
cur.execute("""
BEGIN
MyPkg.MyProc:)cur);
END;""", cur=outcur)

for row in out_cur:
print row

HTH,

-- Gerhard
 
A

A.M

Exactly what I was looking for.

Thanks alot


Gerhard Häring said:
A.M said:
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. [...]

import cx_Oracle

con = cx_Oracle.connect("me/secret@tns")
cur = con.cursor()
outcur = con.cursor()
cur.execute("""
BEGIN
MyPkg.MyProc:)cur);
END;""", cur=outcur)

for row in out_cur:
print row

HTH,

-- Gerhard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,294
Messages
2,571,511
Members
48,206
Latest member
EpifaniaMc

Latest Threads

Top