----- Original Message -----
From: Richard Smith <[EMAIL PROTECTED]>
> INSERT INTO address (per_id,street,city,state,zip)
> VALUES ('SELECT per_id FROM person WHERE first = '<dtml-var first>'
> AND last = '<dtml-var last>'','<dtml-var street>','<dtml-var city>
> ...etc;

You are allowed to place literal values in a select list, so the following
often works:

INSERT INTO address (per_id, street, city, state, zip)
SELECT per_id, <dtml-sqlvar street type=string>, ...
FROM person WHERE <dmlt-sqltest first> AND <dtml-sqltest last>

This is somewhat fragile since it may insert zero, one, or more records,
depending on how many matches there are in 'person'.  If you are confident
that the SELECT will always match one record, it's fine.

Cheers,

Evan @ digicool & 4-am


_______________________________________________
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to