[Zope-dev] ZSQL Methods from Python?

Jim Fulton jim@digicool.com
Fri, 22 Sep 2000 08:43:54 -0400


Monty Taylor wrote:
> 
> Hey, is there any doco about using ZSQL Methods from Python Products?

Not that I'm aware of. You simply call them pretty much like
any other Python callable thing. The signature is:

  someMethod([mapping, **other_arguments])

  where:

     mapping is a mapping object that provides SQL method arguments, and
     can include other information. (The actual name of the positional
     argument may be "REQUEST" ;).  This argument is optional.

     You can also provide arguments as named keywords.  

 


> Also, does anyone know of any work done to extend ZSQL Methods to allow
> stored-procedure calls?

No, but I'd love to see someone tackle it. The semantics
of stored procedures varies so widely accross databases, that
I doubt that it would be easiliy generalizable. I think, at
least for starters, a form of stored procedure support for
Oracle would make alot of sense.

> I know I can do an Oracle Procedure call from
> DCOracle that returns a cursor, but I'd love to combine that with the
> caching/pluggable brains of ZSQL Methods. Is there anything out there on
> this or am I going to have to roll my own?

I think you'd have to roll your own. If you want to 
do something reusable that other people could use, I'd be
happy to provide whatever advice and support I can.

Note that one of the things I like about Oracle's stored procedures
is that they allow me to avoid screwing with cursors in the common case
that I'm getting one row of data.  I can just get the data I need through 
a straight function call.  The DCOracleStorage uses stored procedures
almost exclusively.

Jim


--
Jim Fulton           mailto:jim@digicool.com
Technical Director   (888) 344-4332              Python Powered!
Digital Creations    http://www.digicool.com     http://www.python.org

Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission.  Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.