[Zope-DB] Using ZSQL in ZSQL Methods
Andreas Jung
andreas@andreas-jung.com
Thu, 13 Sep 2001 19:53:15 -0400
Maybe your database supports something like:
insert into mytable ...as select ... from keytable.
I think Oracle can handle that. Another solution is
two use two different ZSQL methods for each of the
SQL statements. Use dtml-in or a PythonScript
to loop over the resultset from the select statement
and then call the ZSQL method with the insert statement
inside the loop.
Andreas
----- Original Message -----
From: "James Davis" <davija@wwc.edu>
To: "Andreas Jung" <andreas@andreas-jung.com>
Sent: Thursday, September 13, 2001 19:37
Subject: Re: [Zope-DB] Using ZSQL in ZSQL Methods
> The problem is that I have been able to find no documentation on how to do
> this. The statement I listed does not work, it is what I am trying to do.
> There seems to be no documentation that shows how to access the results of
> a query from inside of a zsql method
>
> --------------------------------------------------------------------------
----
> James Davis
> WarChild@Null.net
> WarTech Software &
Computers
> 210 N. College Ave #1
> College Place,WA 99324
> 509.526.7624
> http://cs.wwc.edu/~davija
>
> On Thu, 13 Sep 2001, Andreas Jung wrote:
>
> > and what is your problem ?
> > Andreas
> > ----- Original Message -----
> > From: "James Davis" <davija@wwc.edu>
> > To: <zope-db@zope.org>
> > Sent: Thursday, September 13, 2001 19:18
> > Subject: [Zope-DB] Using ZSQL in ZSQL Methods
> >
> >
> > > I need to be able to run a select statement in a zsql method and use
the
> > > results from that select in the same method.
> > >
> > > for example...
> > >
> > > select key from key_tables
> > > <dtml-var sql_delimiter>
> > > insert into my_table values(
> > > [key from above select statement],
> > > other_data
> > > )
> > >
> > >
> > >
> >
> --------------------------------------------------------------------------
> > ----
> > > James Davis
> > > WarChild@Null.net
> > > WarTech Software &
> > Computers
> > > 210 N. College Ave
#1
> > > College Place,WA
99324
> > > 509.526.7624
> > > http://cs.wwc.edu/~davija
> > >
> > >
> > > _______________________________________________
> > > Zope-DB mailing list
> > > Zope-DB@zope.org
> > > http://lists.zope.org/mailman/listinfo/zope-db
> > >
> >
>