Welcome Guest, Not a member yet? Register   Sign In
Insert into multiple tables.
#2

[eluser]Aken[/eluser]
Regarding the query itself - if all of the information you are inserting is brand new (non-existent in the DB anywhere), then you cannot insert into multiple tables at the same time through a single query. You can, however, use transactions if your DB supports them, to prevent any partial inserts or most weird happenings should any part fail.

See the first few StackOverflow article results here for some good information.

An ORM might have some built-in solution that helps keep your code clean, but essentially does either multiple queries or a transaction. That's an option, but I don't know of any specific ORMs that do this off the top of my head (I am unfamiliar with most of them).


Messages In This Thread
Insert into multiple tables. - by El Forum - 08-08-2012, 10:16 PM
Insert into multiple tables. - by El Forum - 08-08-2012, 10:54 PM
Insert into multiple tables. - by El Forum - 08-09-2012, 02:59 PM
Insert into multiple tables. - by El Forum - 08-09-2012, 08:51 PM
Insert into multiple tables. - by El Forum - 08-09-2012, 09:01 PM
Insert into multiple tables. - by El Forum - 08-09-2012, 09:07 PM
Insert into multiple tables. - by El Forum - 08-09-2012, 09:09 PM
Insert into multiple tables. - by El Forum - 08-09-2012, 09:15 PM



Theme © iAndrew 2016 - Forum software by © MyBB