[Zope-DB] mxODBC w/Oracle ODBC Drivers and zSQL Stored Proc Question

M.-A. Lemburg mal at egenix.com
Mon Sep 5 18:55:33 EDT 2005

Edward Muller wrote:
> Would it be possible to execute a query like below using zSQL Methods.
>    tname STRING;
>    select_STRING;
> CALL sp_buildSet(22,330,tname);
>    select_string := 'SELECT * FROM :1';
>    EXECUTE IMMEDIATE select_string USING tname;
> END;
> Assuming that the above is a valid Oracle query.
> Or will we need to execute the stored procedure (sp_buildSet) from a python 
> script/product.
> Never had to call stored procedures before so I don't know if I can from a 
> zSQL Method.

You can use the ODBC notation for calling stored procedures (this
works cross-database):

{call <procname>(<param>,...,<param>)}

or the native Oracle format.

The mxODBC Zope DA also has a special .callproc() method
(see the manual), if you want to have more control over
the procedure call.

Marc-Andre Lemburg

Professional Python Services directly from the Source  (#1, Sep 06 2005)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::

More information about the Zope-DB mailing list