[Zope] How do I use a Z Oracle Connection in a script?

J. Cone jcone@g8labs.com
Tue, 17 Jul 2001 20:35:16 +0100


Hello Dieter,

Please cancel the question below.  I decided I was having the same problem
as Jeff Hotz ([Zope] Python Script Permission Problem) and to adopt the
same solution.  I have extended my pluggable brain and made it go.  The
relevant code is:

  def saveProfile(self, dbase, profile):
    csr = dbase.cursor
    csr.execute("update fred set profile = :prof "
                "where id = :id",
                prof=Binary(profile),# Binary here prevents truncation
                id = self.id);
    dbase._finish()

  <dtml-call "saveProfile(Oracle_database_connection(), newProfile)">

Thanks for your help,
J. Cone.

At 20:30 16/07/01 +0100, J. Cone wrote:
>You are correct that the ZOracleDA object is a function object, although I
>cannot see from reading the source in either db.py or ZSQLMethods/SQL.py or
>Shared/DC/ZRDB/TM.py, where the object function is declared.

<snip>
>At 20:37 16/07/01 +0200, Dieter Maurer wrote:
<snip>
>>I wanted to give you a hint, where to look for the sources.
>>Looking at the sources (the available methods) gives
>>you a feeling how to use it.
<snip>