Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2012

    Unanswered: creating cursors within stored procedures using transition table

    create or replace trigger t1
    after update on emp
    referencing new_table as ntable
    for each row
    mode db2sql
    declare e_name varchar(30);
    declare sal integer;
    declare e_comm integer;
    declare cursor c1
    select ename,salary,comm
    from ntable;
    open c1;
    fetch c1 in e_name,sal,e_comm;
    close c1;

    we cant create a cursor inside a trigger, so we have to create a stored procedure with cursor and call it in the trigger. pls tell me how to create a stored procedure with cursor using transition table.
    i hope i am clear with the question. thanks.

  2. #2
    Join Date
    Jul 2012
    no you are not clear.

  3. #3
    Join Date
    Oct 2009
    221B Baker St.
    Why does someone believe this is an acceptable alternative? There is a reason a cursor cannot be defined within a trigger and you are just trying to "get around" this. The cursor would still execute within the trigger, no?

    If you explain what needs to happen (rather than how it is currently trying to be colved) someone may have a suggestion.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts