FW: [Zope-DB] Re: How do you do update with multiple tables
Charlie Clark
charlie at egenix.com
Mon May 3 08:50:04 EDT 2004
Don't forget than you can do separate DB acts within one Zope transaction
which usually means that things work out very well.
ie. you insert a new user and a new computer and you need to link the two
records via a foreign key such as the computer id which you might let the
RDBMS generate for you. Within a single transaction you can be *certain*
that once you have inserted the pc, the *current* value of the id sequence
will be the correct foreign key for your user. Exactly how this works will
depend on your RDBMS (MySQL / MS SQL) in your case, I think so check your
documentation. But Zope takes all the hard work out of the synchronisation
for you.
If you're going relational, stay relational, rigidly.
http://www.dbdebunk.com/
On 2004-04-30 at 22:08:12 [+0200], Laura McCord wrote:
>
> I was thinking the same thing and I tried that but doesn't that mean
> that when I insert a new user I would have to know the pcid? When I
> enter the user info I want it to be easy enough for the user to be able
> to enter the name of the pc instead of the id. However, when I do the
> update there is no pcid in the users table that will trigger the
> users.pcname to update.
>
> Make sense?
--
Charlie Clark
eGenix.com
Professional Python Services directly from the Source
>>> Python/Zope Consulting and Support ... http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
________________________________________________________________________
::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::
More information about the Zope-DB
mailing list