+ 2

how could I insert different data into different tables at once?

6th Aug 2016, 5:32 AM
Joas Dioniz
Joas Dioniz - avatar
2 Réponses
+ 1
you can create a routine (function or sp) and then call it when you want to multiple insert. eg: delimiter // create function multipleInsert(d1 varchar(20), d2 varchar(20)) begin insert into t1(col1) value(d1); insert into t2(col2) value(d2); end // So whenever you want to insert do this: select multipleInsert('data1', 'data2'); I hpoe it will help.
2nd May 2017, 1:32 AM
Coder
Coder - avatar
+ 2
run multiple queries
10th Aug 2016, 1:08 PM
Ziyaan Hassan
Ziyaan Hassan - avatar