Re: DCOracle2 with a Stored Procedure that Returns a ref_cur
"Maan M. Hamze" <[email protected]> Wed, 21 Mar 2007 03:31:23 -0500
| Newsgroups | gmane.comp.web.zope.database |
|---|---|
| Message-ID | <[email protected]> |
The original issue with stored procedures that return a ref cursor has been resolved and it is working fine. As you mention, it was all along: c2 = c1.procedures.sp1(in1, in2, in3, in4) I was running into a problem with it, but the problem ended up being not with the stored procedure, but with the TIMESTAMP data type, as I mention in another post. DCOracle2 was crashing with a segmentation fault when one tries to fetch a record from a non empty dataset returned by c2. Trying the same thing with DCOracle2 on Windows XP, an actual error message was received that an unknown data type of type SQLT_TIMESTAMP was encountered. This is how I knew that issue was not with a stored procedure returning a ref cursor but with the TIMESTAMP datatype. We are using a new database design in Oracle 10g. The designers chose to use timestamp instead of date, so the issue arose recently. Maan ----- Original Message ----- From: "Matthew T. Kromer" <[email protected]> To: "Maan M. Hamze" <[email protected]> Cc: <[email protected]> Sent: Tuesday, March 20, 2007 8:17 PM Subject: Re: [Zope-DB] DCOracle2 with a Stored Procedure that Returns a ref_cur > If I recall, DCOracle2 returns an array of the OUT parameters from > invoking a stored procedure, so your invocation would be more like > > c2 = c1.sp1(in1, in2, in3, in4) and you wouldn't pass in ref_cur > > but its been a while since I reviewed the code. I know ref cursors used > to work... > > On Mar 16, 2007, at 11:44 AM, Maan M. Hamze wrote: > >> 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? >> Thanks, >> Maan >> >> >> _______________________________________________ >> Zope-DB mailing list >> [email protected] >> http://mail.zope.org/mailman/listinfo/zope-db > >