I have two tables on which I perform some bulk inserts:
- key: key_id (pk), key_name
- related_key: related_key_id (pk), key_id (fk)
values_data = "($$key_1$$), ($$key_2$$)" INSERT INTO key (key_name) VALUES values_data
values_data = "(1, `the id of the first value inserted in key`) , (1, `the id of the sec value inserted in key`)" INSERT INTO related_key (related_key_id, key_id) VALUES values_data
I don't know how to do the second
INSERT because I don't know how to get those ids for the rows inserted in the
Or is there a better way of doing this?