Results 1 to 3 of 3

Thread: What is wrong with this? Help.

  1. #1
    Join Date
    Apr 2006
    Posts
    5

    What is wrong with this? Help.

    hi. Anybody know what wrong with my trigger, i even change it to procedure and also there is error.

    CREATE OR REPLACE TRIGGER UPDATE_MENTOR
    BEFORE INSERT OR UPDATE OR DELETE ON INSTRUCTOR

    BEGIN
    IF TO_CHAR(MONTHS_BETWEEN(sysdate, date_hired)) > '240'
    OR salary>3400 THEN
    END IF;
    END;

    Please help.

  2. #2
    Join Date
    Oct 2005
    Posts
    2,557
    If months between (is that a number, if so, why are you casting it to character??) is whatever, or salary is greater than whatever, then what? You're missing the "what" part after "then."

  3. #3
    Join Date
    Apr 2006
    Posts
    5
    i can change my statement to this also. even then i still get error, after the i just prompt a message.

    CREATE OR REPLACE TRIGGER update_course
    BEFORE INSERT OR UPDATE ON instructor

    BEGIN
    IF MONTHS_BETWEEN (sysdate,date_hired) > 240
    OR salary>3400 THEN
    DBMS_OUTPUT.PUT.LINE('Mentor is identified');
    END IF;
    END;
    /

    thank you..

Posting Permissions

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