Trigger creation
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: Trigger creation

  1. #1
    Join Date
    Sep 2001
    Location
    Mumbai
    Posts
    1
    Hi ,

    Due to migration work the trigger in my schema was dropped.
    It has to be again created.

    When i executed the trigger it shows the following error.

    What should i do.Good Guidance will be helpful.

    SQL> BEGIN
    2 IF INSERTING THEN
    3 INSERT INTO EQPART(EQNUM,ITEMNUM) VALUES
    4 (:new.eqnum,:new.itemnum);
    5 ELSIF DELETING THEN
    6 DELETE FROM EQPART WHERE EQNUM = ld.eqnum AND
    7 ITEMNUM = ld.itemnum;
    8 END IF;
    9 END;
    10
    11 /
    Bind variable "OLD" not declared.

    Thanks in advance

    Dinesh


  2. #2
    Join Date
    Apr 2001
    Location
    Brisbane, Queensland, Australia
    Posts
    1,203
    Wouldn't it be

    SQL> BEGIN
    2 IF INSERTING THEN
    3 INSERT INTO EQPART(EQNUM,ITEMNUM) VALUES
    4 (:new.eqnum,:new.itemnum);
    5 ELSIF DELETING THEN
    6 DELETE FROM EQPART WHERE EQNUM = :new.eqnum AND
    7 ITEMNUM = :new.itemnum;
    8 END IF;
    9 END;

    [Edited by grjohnson on 09-24-2001 at 05:15 AM]
    OCP 8i, 9i DBA
    Brisbane Australia

  3. #3
    Join Date
    Aug 2001
    Location
    Waterloo, On
    Posts
    547
    Did you put the Colon before old?

    :OLD

  4. #4
    Join Date
    Apr 2001
    Location
    Brisbane, Queensland, Australia
    Posts
    1,203
    He definatly did, that's why

    OLD

    looks like

    ld

    Cheers,
    OCP 8i, 9i DBA
    Brisbane Australia

Posting Permissions

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



Click Here to Expand Forum to Full Width