Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2010
    Posts
    5

    Unanswered: Trigger created with compilation errors.

    Below is my code for a trigger and i am getting created with compliation errors and can not see why. The trigger raises the exception when a ticket has been purchased for a soldout flight. my tables are tickets and flights

    create trigger FLIGHT_SOLD_OUT
    after insert or update of SoldSeats
    on FLIGHTS
    for each row
    begin
    if (:new.SoldSeats > capacity) then
    raise_application_error(-20999,'Flight Sold Out!');
    end if;
    end;
    /

  2. #2
    Join Date
    Nov 2003
    Posts
    2,933
    Provided Answers: 12
    Do a "SHOW ERRORS" and it will give you the exact error message.

  3. #3
    Join Date
    Nov 2010
    Posts
    5
    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    2/8 PL/SQL: Statement ignored
    2/29 PLS-00201: identifier 'CAPACITY' must be declared

  4. #4
    Join Date
    Mar 2010
    Location
    Vienna, Austria
    Posts
    149
    sajohnson05,

    there are 3 possible ways to deal with this problem:

    1.) Hoping someone with the same homework assignment posts the answer

    2.) Look at your local junk dealer for a crystal ball

    or

    3.) Post the table structure and the error message you get, and someone here might help you ... ;o)
    "There is always an easy solution to every problem - neat, plausible, and wrong."
    -- H.L. Mencken

  5. #5
    Join Date
    Nov 2003
    Posts
    2,933
    Provided Answers: 12
    Quote Originally Posted by sajohnson05 View Post
    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    2/8 PL/SQL: Statement ignored
    2/29 PLS-00201: identifier 'CAPACITY' must be declared
    Which is pretty self-explanatory, isn't it?

    More details are in the manual:
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/overview.htm#sthref121

Tags for this Thread

Posting Permissions

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