且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在两个表之间有父子关系的情况下将记录插入到两个表中

更新时间:2022-12-09 21:42:29

您需要先填充子表,获取插入行的唯一键,然后在插入父表时将其用作外键桌子.

就像依赖的对象将在稍后填充.
You would need to first populate the child table, get the unique key for the row inserted and then use that as foreign key while inserting in the parent table.

It''s like the one which is dependant will be filled later.