I have a situation where I need to have records inserted into an associated table once a record has been inserted into a main table. The main table has an auto increment id column and I need to retrieve the value for this id to use as the key for the insert of the associated records. I'm thinking the whole thing should be in an sql transaction and then committed or rolled back if the whole thing does not succeed. All the information for the inserts into the main table and assoc table are contained within one row from the source. How can I accomplish this? Javascript?

Gerry