Consider I have two tables, t1 and t2
t1 = (id, name), t2 = (id, fid)
The fid in t2 is a Foreign Key to t1.
Steps to create rows as following.
- Insert a row in t1, get the id
- Use that id and insert as fid in t2.
My problem is:
Since t1's id is unknow when the transaction is not committed, so how to perform the insertion to t2?