Results 1 to 2 of 2
  1. #1
    Join Date
    May 2002
    Location
    Austria
    Posts
    8

    Question Unanswered: Calling SQL-storedproc from a trigger

    Is it possible to call a Sql-storedProc from a trigger in DB2 v7.2 on AIX like:
    create trigger xyz
    ...
    begin
    call dosomething();
    end

    this way unfortunately did not work. :-((

    thanx,
    Aki

  2. #2
    Join Date
    May 2002
    Location
    Austria
    Posts
    8
    I've found the answer...

    Thanx Serge!

    From: Serge Rielau Serge Rielau <srielau@ca.ibm.com>
    Date: 07-23-2001 12:55 PM
    Subject: Re: Triggers and stored procedures

    --------------------------------------------------------------------------------
    Hi Andrew,

    I think it did and some folks answered.

    On DB2 UWO CALL is not a legal statement in a trigger (or any inline SQL PL). If your stored proc id
    READS SQL DATA you might consider turning it into an SQL Fucntion (depending on its complexity).
    Also note that triggers in V7.2 can have procedural logic in them. Often that is a sufficient
    workaround.

    Cheers Serge

Posting Permissions

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