Hello all, I need to perform the following MySQL code (which works in MySQL) in form event onAfterInsert. It must insert multiple records into multiple tables. I cannot figure out the syntax for the event. Here is the MySQL code.
BEGIN;
INSERT INTO module1_1_v2 (item_title, comp_id, module)
VALUES
((SELECT item_title FROM module_item_titles WHERE module = ‘111’),
[comp_id],
(SELECT module FROM module_item_titles WHERE module = ‘111’)),
((SELECT item_title FROM module_item_titles WHERE module = ‘112’),
[comp_id],
(SELECT module FROM module_item_titles WHERE module = ‘112’)),
((SELECT item_title FROM module_item_titles WHERE module = ‘113’),
[comp_id],
(SELECT module FROM module_item_titles WHERE module = ‘113’));
INSERT INTO module1_2_v2 (item_title, comp_id, module)
VALUES
((SELECT item_title FROM module_item_titles WHERE module = ‘121’),
[comp_id],
(SELECT module FROM module_item_titles WHERE module = ‘121’)),
((SELECT item_title FROM module_item_titles WHERE module = ‘122’),
[comp_id],
(SELECT module FROM module_item_titles WHERE module = ‘122’)),
((SELECT item_title FROM module_item_titles WHERE module = ‘123’),
[comp_id],
(SELECT module FROM module_item_titles WHERE module = ‘123’)),
((SELECT item_title FROM module_item_titles WHERE module = ‘124’),
[comp_id],
(SELECT module FROM module_item_titles WHERE module = ‘124’)),
((SELECT item_title FROM module_item_titles WHERE module = ‘125’),
[comp_id],
(SELECT module FROM module_item_titles WHERE module = ‘125’)),
((SELECT item_title FROM module_item_titles WHERE module = ‘126’),
[comp_id],
(SELECT module FROM module_item_titles WHERE module = ‘126’));
COMMIT;