473,466 Members | 1,436 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Python sample code for PLSQL REF CURSORS

A.M
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.

The technique is explained here for Java and Visual Basic:

http://www.oracle-base.com/articles/...Recordsets.php

I am looking for similar code for Python

Any help would be appreciated,

Alan
May 4 '06 #1
2 5206
A.M wrote:
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
May 4 '06 #2
A.M
Exactly what I was looking for.

Thanks alot
"Gerhard Häring" <gh@ghaering.de> wrote in message
news:ma***************************************@pyt hon.org...
A.M wrote:
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

May 4 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Anat | last post by:
Hi, Does anyone know a good python mudule that works with MS SQL server? Thanks, Anat
2
by: Steegg | last post by:
I am a newcomer to using Python and Qt and the main problem that I have is the dearth of any example code or books describing the use of Python and Qt together. My current problem is that I want...
15
by: marvado | last post by:
Hi, can I run phpinfo(); or any php code from an oracle plsql package using htp.p from the oracle web toolkit owa? what I need is to run any php code using htp.p() I might be missing...
4
by: jason.awlt | last post by:
Greetings, I recently being bugged by the following error on my DB2. SQL0902C SQLSTATE = 58005 Reason Code = 14 This error comes out everytime i tried to insert some record to a table...
3
by: gregturn | last post by:
Spring Python is an offshoot of the Java-based SpringFramework and AcegiSecurityFramework, targeted for Python. Spring provides many useful features, and I wanted those same features available when...
0
by: anuptosh | last post by:
Hi, I have been trying to run the below example to get a Oracle Array as an output from a Java code. This is an example I have found on the web. But, the expected result is that the code should...
0
by: Goldfish | last post by:
Key Features The following features have been implemented: * Inversion Of Control - The idea is to decouple two classes at the interface level. This lets you build many reusable parts in your...
0
by: Goldfish | last post by:
Spring Python, the python version of the Spring Framework, has just released version 0.7.1. This patch includes integration with S3, Spring's new service used to distribute binaries. Key...
1
by: Goldfish | last post by:
Spring Python, the python version of the Spring Framework, has just released version 0.8.0. This release contains a refactored IoC container supporting four formats (XMLConfig,...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.