var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: declaring cursors in a trigger
Hi, I am trying to write a "FOR EACH ROW" trigger in which a cursor is declared:
CREATE TRIGGER attrigger AFTER UPDATE ON all_type
REFERENCING OLD AS old NEW AS new
FOR EACH ROW MODE DB2SQL
DECLARE c1 CURSOR FOR SELECT s1 FROM sls;
This results in an error: "SQL0104N An unexpected token 'FOR' was found following 'DECLARE c1 CURSOR'. Expected tokens may include: '<SQL_variable_condition_declaration>'."
Is it possible to have a cursor within the body of a "FOR EACH ROW" trigger?
See my response in a previous reply for what you can do in a trigger: