Creating a Trigger on a Base Table

How to:

You can create a trigger on a base table using a command line in J.D. Edwards World, or a third-party tool, such as DB Visualizer. The following example describes how to create a trigger using a command line in J.D. Edwards World.


Top of page

x
Procedure: How to Create a Trigger on a Base Table

To create a trigger on a base table:

  1. Run STRSQL from a command line.

    The Enter SQL Statements screen opens.

  2. Type the trigger syntax. For example:
    CREATE TRIGGER JDFDATA.GIL_PO_F4311_INSERT AFTER INSERT ON 
    JDFDATA.F4311
           REFERENCING NEW AS N
           FOR EACH ROW MODE DB2SQL
           WHEN    (
                    N.PDDCTO='OP')
           BEGIN ATOMIC
           INSERT INTO JDFDATA.IWAY_JDE
           VALUES
           (
                    CURRENT DATE
                    ,4
                    , CHAR(N.PDDOCO) || ','|| N.PDDCTO || ',' ||
                       CHAR(N.PDLNID)
                    , 'INSERT'
           );
           END

iWay Software