PLS-00103: Encountered the symbol "LOOP" when expecting one of the following: [message #347331] |
Thu, 11 September 2008 05:33 |
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
|
|
|
|
|
|