[DB-SIG] MySQL Multi-Table Insert Strategy

Aaron Bingham abingham at alumni.sfu.ca
Wed Jul 6 20:29:55 CEST 2005


Don Parris <gnumathetes at gmail.com> writes:

> I'm new on the list, and just had a general question about the best
> approach for setting up a multi-table insert.  I know that MySQL
> doesn't support this outright, but would most people recommend using a
> transaction?

This is precisely the kind of thing transactions are for.  By all
means use one.  That way, if something goes wrong with the database or
your program between updating, e.g., the person table and the address
table, the database can't be left in a half-updated state.

If you are not very familiar with databases and will be doing more
work with them, I would recommend you find yourself a good
product-independant book on the topic.  I would recommend An
Introduction to Database Systems by Chris Date
(http://www.amazon.com/exec/obidos/tg/detail/-/0321197844/qid=1120674974/sr=8-1/ref=pd_bbs_ur_1/002-4259272-2816863?v=glance&s=books&n=507846).

Regards,

Aaron


More information about the DB-SIG mailing list