
January 13th, 2006, 12:08 AM
|
|
Registered User
|
|
Join Date: Jan 2006
Posts: 2
Time spent in forums: 17 m 10 sec
Reputation Power: 0
|
|
|
Trigger body with a procedure call..
hi,
i ve some doubts regarding the trigger body, kindly clarify me ..
i am not able to use SQLCODE, CURSORS, Procedure calls.. in a trigger body ..
is there any constraints for using this in a trigger...
My DB2 Version is 8.2.0
OS : Windows 2000
Below is the test procedure sp_print called in the trigger,
Code:
CREATE PROCEDURE sp_print
DYNAMIC RESULT SETS 1
LANGUAGE SQL
BEGIN
DECLARE s_temp_cursor CURSOR WITH HOLD WITH RETURN TO CLIENT
FOR
SELECT * FROM result_table FOR READ ONLY;
open s_temp_cursor;
END
@
The trigger trig_test that calls the above procedure,
Code:
CREATE TRIGGER trig_test AFTER INSERT ON test
REFERENCING NEW_TABLE AS INSERTED
FOR EACH STATEMENT
MODE DB2SQL
TRIGR: BEGIN ATOMIC
INSERT INTO result_table VALUES ( 1 ) ;
call sp_print;
END
@
Regards
Sn
|