Mailing List Archive

mxODBC w/Oracle ODBC Drivers and zSQL Stored Proc Question
Would it be possible to execute a query like below using zSQL Methods.

DECLARE
tname STRING;
select_STRING;
CALL sp_buildSet(22,330,tname);
BEGIN
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.

--
Edward Muller - Interlix
edwardam@interlix.com
417-862-0573
PGP Key: http://interlix.com/Members/edwardam/pgpkeys
Re: mxODBC w/Oracle ODBC Drivers and zSQL Stored Proc Question [ In reply to ]
Hi There,

Edward Muller wrote:
> Never had to call stored procedures before so I don't know if I can from a
> zSQL Method.

I have no idea how mxODBC deals with this, maybe one of the eGenix guys
can comment?

I DO know that ZOracleDA provides a specific Stored Procedure object to
deal with oracle stored procedures, maybe you could give ZOracleDA a
spin and compare?

cheers,

Chris

--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db
Re: mxODBC w/Oracle ODBC Drivers and zSQL Stored Proc Question [ In reply to ]
Edward Muller wrote:
> Would it be possible to execute a query like below using zSQL Methods.
>
> DECLARE
> tname STRING;
> select_STRING;
> CALL sp_buildSet(22,330,tname);
> BEGIN
> 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
eGenix.com

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 ! ::::
_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db