Mailing List Archive

use of cx_oracle adapter from within python script ?
Hi,
I know there is many restrictions when writing python scripts.
But is it possible to access to oracle (import cx_Oracle) from python
script, avoiding to build a ZSQL method for each different query ?
An other reason to do so is the relative complexity of some oracles queries
(package, stored procedure, cursor, ...) , witch are difficult (impossible
?) to implement into ZSQL.

thanks.

--
View this message in context: http://www.nabble.com/use-of-cx_oracle-adapter-from-within-python-script---tf4821845.html#a13794972
Sent from the Zope - DB mailing list archive at Nabble.com.

_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db
Re: use of cx_oracle adapter from within python script ? [ In reply to ]
banaouas wrote at 2007-11-16 07:15 -0800:
>I know there is many restrictions when writing python scripts.

Only "Script (Python)" and derived classes are restricted.

Python in normal Python modules/packages or "External Method"s are
not restricted.

>But is it possible to access to oracle (import cx_Oracle) from python
>script, avoiding to build a ZSQL method for each different query ?

I doubt that this will be able with "Script (Python)" alone.



--
Dieter
_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db
Re: use of cx_oracle adapter from within python script ? [ In reply to ]
In external method, it's not possible to use the database connexion created
in the zmi.
This connexion maintain a pool of connexions to database, thus reducing the
query execution time.

I wonder if from inside a new product it's possible to access to an already
existing database connexion ?


Dieter Maurer wrote:
>
> banaouas wrote at 2007-11-16 07:15 -0800:
>>I know there is many restrictions when writing python scripts.
>
> Only "Script (Python)" and derived classes are restricted.
>
> Python in normal Python modules/packages or "External Method"s are
> not restricted.
>
>>But is it possible to access to oracle (import cx_Oracle) from python
>>script, avoiding to build a ZSQL method for each different query ?
>
> I doubt that this will be able with "Script (Python)" alone.
>
>
>
> --
> Dieter
> _______________________________________________
> Zope-DB mailing list
> Zope-DB@zope.org
> http://mail.zope.org/mailman/listinfo/zope-db
>
>

--
View this message in context: http://www.nabble.com/use-of-cx_oracle-adapter-from-within-python-script---tf4821845.html#a13803219
Sent from the Zope - DB mailing list archive at Nabble.com.

_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db
Re: use of cx_oracle adapter from within python script ? [ In reply to ]
banaouas pisze:
> In external method, it's not possible to use the database connexion
created
> in the zmi.
Why? It is possible. I think if you take a look into zope-db archives
you'll even find some examples, eg:

http://www.nabble.com/Re:-RE-:-How-lunch-SQL-request-from-python-script---t3039608.html

--
Maciej Wisniowski
_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db