[Zope-DB] [SOLVED]: ZSQL meyhod fr an Oracle Stored Procedure that Returns a ref_cur

banaouas banaouas.medialog at wanadoo.fr
Mon Nov 19 03:56:32 EST 2007

Initially, I needed to access to this oracle database only for read
But even for read only access, it might be a good practice to add this
commit, cause sometime database engins hold some kind of lock on the read
data, depending on how transaction was started.

I imagine that zsql class do implicitely this commit ?

In other part, it would be usefull to "separate" two operations , data
quering and result container building in
the ZcxOracleDA.query method. So, we can "format" any cursor with the same
structure if the (simple) statement was processed directly by .query method.

Willi Langenberger wrote:
> According to m.banaouas:
>> 2-add a python script for external method in Plone\Data\Extensions :
>> # myscript.py
>> def mymethod(self , somename):
>>   conn    = self.myconnection()
>>   curext  = conn.db.cursor()
>>   curint  = conn.db.cursor()
>>   sql     = "begin MY_PACKAGE.MY_PROC(:p_Cursor, :p_NAME); end;"
>>   curext.execute(sql, (curint, somename))
>>   data    = TransformCursorIntoReadableText(curint)
>>   return data
> If you are writing to a transactional database, you should add
>   conn._register()
> to register that connection for the zope transaction
> machinery. That way the Zope Publisher calls "commit" at the end of a
> successful request (or "abort" on error).
> \wlang{}
> -- 
> Willi.Langenberger at wu-wien.ac.at                Fax: +43/1/31336/9207
> Zentrum fuer Informatikdienste, Wirtschaftsuniversitaet Wien, Austria
> _______________________________________________
> Zope-DB mailing list
> Zope-DB at zope.org
> http://mail.zope.org/mailman/listinfo/zope-db

View this message in context: http://www.nabble.com/ZSQL-meyhod-fr-an-Oracle-Stored-Procedure-that-Returns-a-ref_cur-tf4818086.html#a13829942
Sent from the Zope - DB mailing list archive at Nabble.com.

More information about the Zope-DB mailing list