Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> PL/SQL Trigger (PLS-00201: identifier '...' must be declared)

PL/SQL Trigger (PLS-00201: identifier '...' must be declared)

From: Pete <sitsseut_at_stud.informatik.uni-erlangen.de>
Date: Mon, 6 Jun 2005 22:27:13 +0200
Message-ID: <3gjpuqFcr5v8U2@news.dfncis.de>


Hi!

I´m new to Oracle and have a problem when i try to create a trigger. Is it possible to reference the values that should be inserted? If yes, how is it possible?

Here is my code:

--

CREATE OR REPLACE TRIGGER test_trigger_fik BEFORE INSERT
ON flight_intervals
REFERENCING new inserted
FOR EACH ROW DECLARE
 la_time flight_intervals.arrival_time%TYPE;  d_time flight_intervals.arrival_time%TYPE;  la_airport flight_intervals.from_airport%TYPE;  d_airport flight_intervals.from_airport%TYPE;  f_id flight_intervals.flight_id%TYPE;

BEGIN
 f_id := inserted.flight_id;
 SELECT MIN(arrival_time) INTO la_time
 FROM flight_intervals
 WHERE flight_id = f_id
 ORDER BY arrival_time;
 IF SQL%NOTFOUND
  THEN la_time := inserted.arrival_time;  END IF; ...

END;
/
show error;

exit;

--

I always reveive the following errors:
9/2 PL/SQL: Statement ignored
9/10 PLS-00201: identifier 'INSERTED.FLIGHT_ID' must be declared 15/8 PL/SQL: Statement ignored
15/19 PLS-00201: identifier 'INSERTED.ARRIVAL_TIME' must be declared

Can anyone help me?

Thanks!
Pete Received on Mon Jun 06 2005 - 15:27:13 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US