Home » SQL & PL/SQL » SQL & PL/SQL » Encountered the symbol "end-of-file" when expecting one of the following: ;(3 Merged) (Oracle SQL Developer 1.5.1)
icon11.gif  Encountered the symbol "end-of-file" when expecting one of the following: ;(3 Merged) [message #515318] Sun, 10 July 2011 09:11 Go to next message
mars6263
Messages: 4
Registered: July 2011
Junior Member

I am attempting to run this query and I get the following error -

BEGIN
FOR REC IN (SELECT * FROM HARRELATYPE) LOOP SP_ADD_CODE('Orion.Attachment','NatureOfRelation',RTRIM(REC.RELATYPECODE),RTRIM(REC.RELATYPENAME));
END LOOP;
COMMIT;


PL/SQL compilation error
Encountered the symbol "end-of-file" when expecting one of the following: ;

06550.0000 - "line %s, column %s: \n%s"

Any help would be great and Thanks
Re: Encountered the symbol "end-of-file" when expecting one of the following: ; [message #515320 is a reply to message #515318] Sun, 10 July 2011 09:15 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/

how do you have "END LOOP" without ever having "LOOP" to start it?
Re: Encountered the symbol "end-of-file" when expecting one of the following: ; [message #515322 is a reply to message #515320] Sun, 10 July 2011 09:18 Go to previous messageGo to next message
mars6263
Messages: 4
Registered: July 2011
Junior Member

I do I have the following

FOR REC IN (SELECT * FROM HARRELATYPE) LOOP


BEGIN


FOR REC IN (SELECT * FROM HARRELATYPE) LOOP

SP_ADD_CODE('Orion.Attachment','NatureOfRelation',RTRIM(REC.RELATYPECODE),RTRIM(REC.RELATYPENAME));

END LOOP;

COMMIT;

Re: Encountered the symbol "end-of-file" when expecting one of the following: ; [message #515326 is a reply to message #515322] Sun, 10 July 2011 09:33 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/

DECLARE
BEGIN
    FOR rec IN (SELECT *
                FROM   harrelatype) LOOP
Sp_add_code('Orion.Attachment', 'NatureOfRelation', Rtrim(rec.relatypecode), Rtrim(rec.relatypename));
END LOOP;

COMMIT;
END;  
Re: Encountered the symbol "end-of-file" when expecting one of the following: ; [message #515327 is a reply to message #515322] Sun, 10 July 2011 09:35 Go to previous messageGo to next message
Littlefoot
Messages: 21825
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
There's some missing information; what is "Orion" (in 'Orion.Atatchment')? What is 'NatureOfRelation'? As you put it, these are ordinary strings.

Your PL/SQL block misses the END.

This, I hope, would compile:
BEGIN
  FOR REC IN (SELECT * FROM HARRELATYPE) LOOP 
    SP_ADD_CODE('Orion.Attachment', 
                'NatureOfRelation', 
                RTRIM(REC.RELATYPECODE), 
                RTRIM(REC.RELATYPENAME)
               );
  END LOOP;
  COMMIT;
END;

SP_ADD_CODE seems to be a procedure; is it valid? If not, what happens when you try to compile it?

[Updated on: Sun, 10 July 2011 09:36]

Report message to a moderator

Re: Encountered the symbol "end-of-file" when expecting one of the following: ; [message #515328 is a reply to message #515327] Sun, 10 July 2011 09:40 Go to previous messageGo to next message
mars6263
Messages: 4
Registered: July 2011
Junior Member

no it gave this error and the and the "Orion" (in 'Orion.Attachment')? is the attachment type from the ATTACHMENTS tbl.

Error report:
ORA-06550: line 3, column 5:
PLS-00201: identifier 'SP_ADD_CODE' must be declared
ORA-06550: line 3, column 5:
PL/SQL: Statement ignored
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
Re: Encountered the symbol "end-of-file" when expecting one of the following: ; [message #515329 is a reply to message #515328] Sun, 10 July 2011 09:41 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/

It is really, Really, REALLY difficult to fix a problem that can not be seen.
use COPY & PASTE so we can see what you do & how Oracle responds.

[Updated on: Sun, 10 July 2011 09:42]

Report message to a moderator

Re: Encountered the symbol "end-of-file" when expecting one of the following: ; [message #515330 is a reply to message #515329] Sun, 10 July 2011 09:49 Go to previous messageGo to next message
mars6263
Messages: 4
Registered: July 2011
Junior Member

ah ok.. Attached is the SQL script. The following is the error when the script ran. Thanks for your time

Error report:
ORA-06550: line 3, column 5:
PLS-00201: identifier 'SP_ADD_CODE' must be declared
ORA-06550: line 3, column 5:
PL/SQL: Statement ignored
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
Re: Encountered the symbol "end-of-file" when expecting one of the following: ; [message #515331 is a reply to message #515330] Sun, 10 July 2011 09:57 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Have you ever successfully written PL/SQL procedure?

for the third & final time

It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/

>PLS-00201: identifier 'SP_ADD_CODE' must be declared
fix above syntax error
Re: Encountered the symbol "end-of-file" when expecting one of the following: ; [message #515334 is a reply to message #515330] Sun, 10 July 2011 11:25 Go to previous message
Michel Cadot
Messages: 68765
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Quote:
ah ok.. Attached is the SQL script.

Do not attach the script, Use SQL*Plus and copy and paste your session, the WHOLE session.

Before, Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version, with 4 decimals.

Regards
Michel
Previous Topic: Error: ORA-06533 subscript beyond count
Next Topic: Characters format on the Web
Goto Forum:
  


Current Time: Tue Aug 05 04:02:11 CDT 2025