P pikthai2004 Member Licensed User Longtime User Jul 29, 2017 #1 Hi every one, I want to insert and update multi tables (Each tables are related) on jRDC2 (mySQL) I searched the forum and found the ExecuteBatch command but it 's not clear . I checked the ExecuteBatch command but it execute multiple commands one by one . I want the solution or idea to do some thing like this For example 1.add new record to tableA 2.calculate total amount from tableA (all records) then update tableB 3.update last id from step 1 to tableC All steps in 1 transaction. Thank you in advance.
Hi every one, I want to insert and update multi tables (Each tables are related) on jRDC2 (mySQL) I searched the forum and found the ExecuteBatch command but it 's not clear . I checked the ExecuteBatch command but it execute multiple commands one by one . I want the solution or idea to do some thing like this For example 1.add new record to tableA 2.calculate total amount from tableA (all records) then update tableB 3.update last id from step 1 to tableC All steps in 1 transaction. Thank you in advance.
Erel B4X founder Staff member Licensed User Longtime User Jul 30, 2017 #2 All the commands will be executed in the same transaction. So you can safely use LAST_INSERT_ID() (or any similar command) to get the id of the last insert. Upvote 0
All the commands will be executed in the same transaction. So you can safely use LAST_INSERT_ID() (or any similar command) to get the id of the last insert.