I need to insert rows into two tables, the problem is that i need the generated id (a primary key) from the first table to store it onto the next table.
something like :
INSERT INTO aaaa (text) VALUES ('Some info');
INSERT INTO bbbb (aaaaid, sometext) VALUES (?????, 'Some text');
where aaaaid is the id of the row inserted in the first statement.
i know how to use nextval. but is it compatible with other RDBMS's? (i use pgsql). How safe is it when it comes to muti-user highvolume databases?