Home » Other » Test » PLS-00103: Encountered the symbol "LOOP" when expecting one of the following:
PLS-00103: Encountered the symbol "LOOP" when expecting one of the following: [message #347331] Thu, 11 September 2008 05:33 Go to next message
kishan_nag
Messages: 19
Registered: June 2005
Location: Mumbai
Junior Member

I am getting below error while executing the procedure.Pls help me

Regards,
Ram Kishan

Error:
PLS-00103: Encountered the symbol "LOOP" when expecting one of the following:

Procedure:
CREATE OR REPLACE PROCEDURE cleanup as
cursor c_pug is
select * from purgeconfig where purge_flag ='Y' and Purge_Update_flag = 'N';
qry_stmt varchar2(200);
BEGIN
update purgeconfig set Purge_Update_flag = 'N' where purge_flag ='Y' ;
commit;
for i in c_pug loop
if i.retention_type = 'D' then
qry_stmt := 'delete from ' ||i.tablename|| ' where ' || i.key_column || ' <= sysdate - ' || i.retention_period;
elseif
qry_stmt := 'delete from ' ||i.tablename|| ' where ' || i.key_column || ' <= sysdate - NUMTOYMINTERVAL(' || i.retention_period || ',''MONTH'')';
DBMS_OUTPUT.put_line (qry_stmt);
else
qry_stmt := 'delete from ' ||i.tablename|| ' where ' || i.key_column || ' <= sysdate - NUMTOYMINTERVAL(' || i.retention_period || ',''YEAR'')';
DBMS_OUTPUT.put_line (qry_stmt);
end if;
EXECUTE IMMEDIATE qry_stmt;
end loop;
END;
/

[Updated on: Thu, 11 September 2008 05:37]

Report message to a moderator

Re: PLS-00103: Encountered the symbol "LOOP" when expecting one of the following: [message #347350 is a reply to message #347331] Thu, 11 September 2008 06:10 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
This is not a forum to post your question.
It is just to test how to post.
If this is what you wanted to do, you failed as it is not formatted.
Please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter) and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version (4 decimals).

If you wanted to post a real question, you are in the wrong forum, you have to post in SQL & PL/SQL one but before read the above links and learn how to post.

Regards
Michel

Re: PLS-00103: Encountered the symbol "LOOP" when expecting one of the following: [message #347509 is a reply to message #347350] Thu, 11 September 2008 23:34 Go to previous messageGo to next message
kishan_nag
Messages: 19
Registered: June 2005
Location: Mumbai
Junior Member

Thanks a lot for your help.

Regards,
Ram
Re: PLS-00103: Encountered the symbol "LOOP" when expecting one of the following: [message #347512 is a reply to message #347509] Fri, 12 September 2008 00:04 Go to previous message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
What "help" are you talking about? Michel's reply was more a "tip" because - if you REALLY have a problem (and it seems you do), it has remained unsolved.

Would you like your question to be moved into a more appropriate forum (SQL & PL/SQL one, for example)?
Previous Topic: SQL
Next Topic: test
Goto Forum:
  


Current Time: Thu Mar 28 12:47:03 CDT 2024