Home » SQL & PL/SQL » SQL & PL/SQL » Encountered the symbol "end-of-file" when expecting one of the following:
Encountered the symbol "end-of-file" when expecting one of the following: [message #298312] Tue, 05 February 2008 11:50 Go to next message
slogtest
Messages: 2
Registered: January 2008
Location: CA
Junior Member

Hi,

I am getting a error message in the the following code, can any one help me out. Thanks in advance.

CREATE OR REPLACE TRIGGER tab1_trig
 BEFORE
 INSERT
 ON tab1
REFERENCING NEW AS NEW OLD AS OLD
 FOR EACH ROW
 BEGIN
    SELECT tab1_seq.NEXTVAL   INTO :NEW.ky_tab1 FROM dual
    
END tab1_trig;

Re: Encountered the symbol "end-of-file" when expecting one of the following: [message #298321 is a reply to message #298312] Tue, 05 February 2008 12:05 Go to previous messageGo to next message
Michel Cadot
Messages: 64144
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
";" is missing at the end of select.
And "/" after the whole statement to execute it.

Regards
Michel

[Updated on: Tue, 05 February 2008 12:05]

Report message to a moderator

Re: Encountered the symbol "end-of-file" when expecting one of the following: [message #298323 is a reply to message #298321] Tue, 05 February 2008 12:08 Go to previous messageGo to next message
slogtest
Messages: 2
Registered: January 2008
Location: CA
Junior Member

no it still says.

Encountered the symbol "end-of-file" when expecting one of the following:
;



Re: Encountered the symbol "end-of-file" when expecting one of the following: [message #298382 is a reply to message #298323] Wed, 06 February 2008 00:05 Go to previous message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
praveen.molugu wrote on Tue, 05 February 2008 19:08
no it still says.

Encountered the symbol "end-of-file" when expecting one of the following: ;


You are kidding, right?
SQL> CREATE TABLE tab1 (ky_tab1 NUMBER);

Table created.

SQL> CREATE SEQUENCE tab1_seq;

Sequence created.

SQL> CREATE OR REPLACE TRIGGER tab1_trig
  2    BEFORE INSERT ON tab1
  3    FOR EACH ROW
  4  BEGIN
  5    SELECT tab1_seq.NEXTVAL
  6    INTO :NEW.ky_tab1
  7    FROM dual;
  8
  9  END tab1_trig;
 10  /

Trigger created.

SQL>

Previous Topic: ORA-04068: existing state of packages has been discarded
Next Topic: Yes/No in columns
Goto Forum:
  


Current Time: Fri Dec 09 11:27:14 CST 2016

Total time taken to generate the page: 0.10841 seconds