[Zope-DB] DCOracle2 with a Stored Procedure that Returns a ref_cur

Maciej Wisniowski maciej.wisniowski at coig.katowice.pl
Fri Mar 16 14:11:32 EDT 2007


> I am using DCOCralce2 with Python 2.41, and Oracle 9.
> I have a stored procedure (sp1) that takes 4 IN parameters, with one OUT
> parameter.  The OUT parameter is a **ref_cursor** that holds a data set.
> I am doing the following:
> db = DCOracle2.connection(connectionString)
> C1 = db.cursor()
> C2 = db.cursor()
> #I run the following holding the result into the cursor C2
> #since the OUT param is a ref_cur
> C2 = C1.sp1(INparam1, INparam2,INparam3,INparam4, ref_cur)
> 
> I expect to get a data set
> I know there is data when sp1 is run
> But I am getting an empty data set when I fetch data via C2 cursor.
> Do you have any idea how to make this work when a stored procedure has a
> ref_cur OUT parameter?
I've used stored procedures in DCOracle2 but I don't remember if
I was dealing with ref_cursors. I think I did this with SQLRelay.

So do you really have to use DCOracle2?
I see that your code is plain python. You're not using
Zope database adapter here(?) so maybe it is better to use something
that is in active developement like cx_Oracle or SQLRelay? You'll avoid
some problems, eg. DCOracle2 is not 64 bit compatible.

-- 
Maciej Wisniowski


More information about the Zope-DB mailing list