i face this error when trying to compile this pl/sql block
Error: PLS-00103: Encountered the symbol “THEN” when expecting one of the following: := . ( % ;
declare CURSOR abc IS select * from all_Objects; begin for rec in abc loop if rec.object_id is null then null; elseif rec.owner is null then null; end if; end loop; end;
You need to change ELSEIF to ELSIF .
your code would be like this :
[code]declare
CURSOR abc IS select * from all_Objects;
begin
for rec in abc
loop
if rec.object_id is null then
null;
elsif rec.owner is null then
null;
end if;
end loop;
end;[/code]