Re: [SOLVED]: ZSQL meyhod fr an Oracle Stored Procedure that Returns a ref_cur

Willi Langenberger <[email protected]> Mon, 19 Nov 2007 09:34:23 +0100
Newsgroups gmane.comp.web.zope.database
Message-ID <[email protected]>
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{}

-- 
[email protected]                Fax: +43/1/31336/9207
Zentrum fuer Informatikdienste, Wirtschaftsuniversitaet Wien, Austria