Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2014
    Posts
    5

    Unanswered: I don't want to use FOR EACH ROW condition in trigger

    Hi All,

    I have created a trigger in my database for updation of previous year values while i upload data into RS_KPI_DLR_DETAIL table.

    here is the Trigger definition-

    CREATE TRIGGER ASPECT.RS_DLR_PREV_VALUE_TRIGGER
    AFTER INSERT ON ASPECT.RS_KPI_DLR_DETAIL
    FOR EACH ROW MODE DB2SQL
    BEGIN ATOMIC
    CALL ASPECT.RS_DEALER_PREV_DATA_POPULATE('81930');
    END


    Here RS_DEALER_PREV_DATA_POPULATE is my procedure that i want to trigger when i insert data into RS_KPI_DLR_DETAIL table.

    So this is working fine, but this is working with each row insertion, and i have a excel file by which i will populate 10000 rows at a time.

    So i want that this RS_DEALER_PREV_DATA_POPULATE procedure will run after whole data insertion.

    I doesn't want FOR EACH ROW MODE in my trigger. how it is possible.

    Can anyone help me.

    Thanks in advance.

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Is this a trick question? May be you can use FOR EACH STATEMENT instead of FOR EACH ROW?
    ---
    "It does not work" is not a valid problem statement.

  3. #3
    Join Date
    Dec 2007
    Location
    Richmond, VA
    Posts
    1,328
    Provided Answers: 5
    sounds like you do not want a trigger. You want to trigger the start of your procedure when you complete your work on the input file. So how about it be the next step in however you are doing your inserts?
    Dave

  4. #4
    Join Date
    Sep 2014
    Posts
    5
    No No I want to trigger it, but my question is i want to trigger it after my whole data has been inserted into my table.

    Moreover FOR EACH ROW concept for trigger works when i insert a single row into my table then it start triggering the process. but i want when i am done with all the 10000 rows and now i have data into my table after that it should be trigger. but it is not happening due to FOR EACH ROW.

    So i want solution for that.

Posting Permissions

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