[Zope] ZSQL dtml request problem

Davis Mr MR M.R.Davis@rmcs.cranfield.ac.uk
Thu, 12 Jun 2003 17:11:43 +0100


Hi,

I'm trying to push the last_inset_id from an Insert statement onto the
request namespace, so I can pick it up and retrieve the new record for
display.

My ZSQL method looks like this.

INSERT INTO suppliers (insert statements removed)
<dtml-var sql_delimiter>
SELECT last_insert_id() AS lastinsertid
<dtml-call "REQUEST.set('id',lastinsertid)">

It comes back with a NameError - global name 'lastinsertid' is not defined.

How do I either get the dtml-call to see the lastinsetid variable, or grab
the value by using the sql statement inside the dtml-call statement.

It's driving me mad
Cheers
Michael