After using INSERT_ALL the table(PM_Table) is not updated, not sure what I am missing here ?
DELIMITER //
create or replace procedure PM (Ids ARRAY(varchar(4000) NOT NULL))
AS
DECLARE
len int = LENGTH(Ids);
j int = 0;
arr ARRAY(RECORD(Id_ VARCHAR(4000), source VARCHAR(4000), target VARCHAR(4000),
source_time DATETIME, target_time DATETIME, time_diff TIME, msg VARCHAR(4000)));
BEGIN
while j < len LOOP
declare
Id INT = Ids[j];
stm text;
qry query(Id_ VARCHAR(4000), source VARCHAR(4000), target VARCHAR(4000),
source_time DATETIME, target_time DATETIME, time_diff TIME, msg VARCHAR(4000)) =
select Id_, source, target, source_time, target_time, time_diff, msg from report(Id);
x INT = 0;
BEGIN
arr = collect(qry);
x = INSERT_ALL("PM_Table", arr);
END;
j += 1;
END LOOP;
end //;
DELIMITER ;
CALL PM ([“1”, “31”]);