ibazz — 2010-02-27T09:06:22-05:00 — #1
I wonder is it possible to do an insert to >1 table where each table is in a separate database?
insert into db1.table AND db2.table
VALUES( ?, ?, ?, ? )
I am trying to plan how to make a test db and a live db each have the same values so that I can test my scripts in a dummy environment and so, not break my live db.
If not possible then I suppose I need to look into some method of database syncronisation or something.
scallioxtx — 2010-02-27T10:51:14-05:00 — #2
As can be seen in the manual, you can only insert values into one table at the time.
You might want to look into transactions.
r937 — 2010-02-27T12:57:56-05:00 — #3
dump the database, open the sql file in a competent text editor, leave the CREATE TABLE statements as is, remove excess INSERT statements (the test database should normally not need to be as big as the live database), and then run the sql file to create your test database
lather, rinse, repeat
ibazz — 2010-02-27T17:02:26-05:00 — #4
Thank you both.
Rudy, you make it all sound so simple. I'll give it a go in a couple of days and see how I get on.