[Zope-dev] Programmatically accessing Z SQL Methods

Mike Pelletier mike@compar.com
Thu, 4 Mar 1999 11:09:28 -0500 (EST)


    I've got a pretty solid understanding of how to get around Zope from the
Product API point of view, and there is good documentation on using Z SQL
Methods from the DTML point of view.  I'm finding myself in the grey
overlapping area, and there isn't a lot of documentation yet.  I'm finding
myself having trouble getting started.  Here's a deal: If I get a boost up the
learning curve with a few answers, I'll put it in a How-To once I understand
it all.

    I would like the user to select the Database Connection when my Product is
being added.  When the Product installs itself, I want it to check the
database it's been passed for the existance of a particular table.  If it does
not exist, I want to create said table and do some initial populating.

    So far my scheme for doing this involves adding a Z SQL Method to the
current folder, putting some SQL in it, running it, putting some SQL in it,
running it, etc, etc, and then removing it when I'm done.  This seems like a
stupid way to go about things.  I'd much rather just be able to take my
connection and submit some SQL programmatically.  So, I guess question is
simply, "How do I submit an SQL query, starting from a connection_id?"

Thanks,
Mike.

-- 
       ---              | Mike Pelletier             Work: 519-746-1607
        /opeware!       | Software Developer         Home: 519-725-7710
       ---              | mike@zopeware.com           Fax: 519-746-7566
http://www.zopeware.com | Zopeware is not endorsed by Digital Creations