insert trigger problem
Posted in 1997
S�ren �rendahl Mikkelsen — — source: Informix-list mailing list archive (1991-1998)
Can an insert trigger update the row data that starts the trigger.
E.g.
If I have table tab_1 and procedure prod_2 as illustrated below.
CREATE TABLE tab_1
(
col1 INTEGER,
col2 INTEGER);
CREATE PROCEDURE prod_1(column_1 INTEGER)
RETURNING INTEGER;RETURN column_1;
END PROCEDURE;
The statement "insert into tab_1 (col1) values (34);" will insert 34
into col1.
Is it possible to create an insert trigger on tab_1 that calls prod_1
and place the result of prod_2 in col2 ?
Below trigger does not do the job.
CREATE TRIGGER trig_1INSERT ON tab_1
REFERENCING NEW AS post
FOR EACH ROW(EXECUTE PROCEDURE prod_1(post.col1) INTO post.col2);
\\Soeren Mikkelsen