Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Posts
    1

    Unanswered: PLS-00103: when creating trigger.

    Hello out there!

    I get the following error when I create the following trigger:

    Errors for TRIGGER TERM_GROUP_AFTER_INSERT_:

    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    16/24 PLS-00103: Encountered the symbol "" when expecting one of the
    following:
    <an identifier> <a double-quoted delimited-identifier> delete
    exists prior <a single-quoted SQL string>

    SQL>

    CREATE OR REPLACE TRIGGER Term_Group_After_Insert_
    AFTER INSERT ON EA_ATM_TERM_GROUP
    FOR EACH ROW
    BEGIN
    UPDATE EA_ATM_TERM_FACT
    SET TERM1_KEY =
    (select :NEW.term1_key from ea_atm_term_group b
    ),
    TERM2_KEY =
    (select :NEW.term2_key from ea_atm_term_group b
    ),
    TERM3_KEY =
    (select :NEW.term3_key from ea_atm_term_group b
    )
    where term_key <> 0 and
    term1_key = 0 and
    term_key in
    ( select max(a.term_key) from ea_atm_terminal a
    where a.term_id = b.:NEW.aterg_term_id )
    ;
    END;



    What's wrong, I do not have any"" in the code!
    Thanks for a hint!

  2. #2
    Join Date
    Sep 2003
    Location
    The Netherlands
    Posts
    311
    hi,

    i don't know where the error concerning the double quotes come from, but i do know that the trigger will not execute. Since u select from the same table u created a row insert trigger, the first time the trigger executes u get the error: table is mutating, trigger may not see it.
    Also i do not see the IS or AS keyword.

    try this:
    CREATE OR REPLACE TRIGGER Term_Group_After_Insert_
    AFTER INSERT ON EA_ATM_TERM_GROUP
    FOR EACH ROW
    IS
    BEGIN
    UPDATE EA_ATM_TERM_FACT
    SET TERM1_KEY = :NEW.term1_key
    ,TERM2_KEY = :NEW.term2_key
    ,TERM3_KEY = :NEW.term3_key
    where term_key <> 0 and
    term1_key = 0 and
    term_key in
    ( select max(a.term_key) from ea_atm_terminal a
    where a.term_id = b.:NEW.aterg_term_id );
    END;

    Hope this helps
    Edwin van Hattem
    OCP DBA / System analyst

Posting Permissions

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