Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2003
    Posts
    3

    Unanswered: How to crete a temporary table object in trigger?

    I have some problems to convert a trigger from Oracle to DB2.
    I have two questions regarding DB2 trigger code

    1. How to crete a temporary table object in trigger?
    In Oracle PL/SQL I do that as follows

    CREATE OR REPLACE TRIGGER Test
    BEFORE INSERT ON MyTestTable
    FOR EACH ROW

    DECLARE
    TYPE MY_TABLE IS TABLE OF VARCHAR2(20);
    BEGIN
    MY_ARRAY := MY_TABLE('trial') ;
    MY_ARRAY.EXTEND;
    MY_ARRAY(1) := 'MY_STRING';
    -----------
    -----------
    END;

    How to do this in DB2?

    2. How do I know what SQL operation activated the trigger inside the
    trigger body?
    I mean, I need to know whether an update or insert operation which
    activated the trigger?

    Please help me.

    Many thanks in advance
    Ravan

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    See my response to a similar post on what you can do in a trigger.

    http://dbforums.com/t669690.html

    Andy

Posting Permissions

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