Insert two two tables in one query?

Hi,

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( ?, ?, ?, ? )
    WHERE 1

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.

bazz

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.

it isn’t

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

vwalah, eh

:cool:

Thank you both.

Rudy, you make it all sound so simple. :slight_smile: I’ll give it a go in a couple of days and see how I get on.

bazz