[Zope-DB] Assign query result(nextval) to variable

Charlie Clark charlie@begeistert.org
Fri, 02 May 2003 17:19:02 +0200

On 2003-05-02 at 17:01:40 [+0200], Israel Carr wrote:
> I'm trying to grab the nextval of a sequence to write to records 
> containing this value into multiple tables.  I can obtain the nextval 
> using:
> select nextval('project_sequence_id_key'::text);
> How do I assign this obtained value to a variable that can be inserted 
> into columns?
> Below is a of the ZSQL method I'm trying to test with and the error I 
> receive.  Let me know if I'm out in left field or beyond!
> __________________________________________________
 <dtml-var projid>
 projid = "select nextval('project_sequence_id_key'::text);"

use a PythonScript to obtain projid and pass it the ZSQLmethod.
I don't recommend lumping SQL statements like this together.