[Zope-DB] How do you do update with multiple tables
Laura McCord
Laura.McCord at doucet-austin.com
Fri Apr 30 14:55:23 EDT 2004
First of all, I am passing an argument 'pcname'.
I have two tables that are linked by pcname
Table Users Table pcTable
userid pcid
username |-------- pcname
useremail | pcmake
useroffice | pcmodel
userpwd | pcserial
pcname--------
If I want to update the pcname in the pcTable then I want the pcname in
the users table to update as well. How is this done? This is what I have
so far:
update pcTable ,users
set
pcTable.pcname = '<dtml-var name="pcname" sql_quote>',
pcTable.pcmake = '<dtml-var name="pcmake" sql_quote>',
pcTable.pcmodel = '<dtml-var name="pcmodel" sql_quote>',
pcTable.pcserial = '<dtml-var name="pcserial" sql_quote>',
pcTable.pcmhz = '<dtml-var name="pcmhz" sql_quote>',
pcTable.pcmbram = '<dtml-var name="pcmbram" sql_quote>',
pcTable.pc_oem_os = '<dtml-var name="pc_oem_os" sql_quote>',
pcTable.pc_oem_os_key = '<dtml-var name="pc_oem_os_key" sql_quote>',
pcTable.pc_ip_add = '<dtml-var name="pc_ip_add" sql_quote>',
users.pcTable = '<dtml-var name="pcname" sql_quote>'
where
pcname = '<dtml-var name="pcname" sql_quote>'
Is there something that I am forgetting?
Thanks,
Laura
More information about the Zope-DB
mailing list