I need to make a big update to the script - not the SPL (stored procedure). This should be written for Informix db.
It includes inserting rows into several tables, each of which depends on the insertion sequence in the previous table.
I know that I can access the series by doing this:
SELECT DISTINCT dbinfo('sqlca.sqlerrd1') FROM systables
but I can’t define a local variable to save it before pasting into the following table.
I want to do this:
insert into table1 (serial, data1, data2) values (0, 'newdata1', 'newdata2');
define serial1 as int;
let serial1 = SELECT DISTINCT dbinfo('sqlca.sqlerrd1') FROM systables;
insert into table2 (serial, data1, data2) values (0, serial1, 'newdata3');
But, of course, Informix parses the definition string.
Is there a way to do this without creating it as a stored procedure, run it once and then delete the procedure?
source
share