set serveroutput on declare date1 varchar2(8); cursor mycursor is select xtrq from p9pip.yhdl; begin open mycursor; fetch mycursor into date1; loop exit when not mycursor%FOUND; if date1= '20040321' then dbms_output.put_line('success!'); end if; fetch mycursor into date1;/////////////// end loop; close mycursor; end;
declare
date1 varchar2(8);
cursor mycursor is select xtrq from p9pip.yhdl;
begin
open mycursor;
fetch mycursor into date1;
loop
exit when not mycursor%FOUND;
if date1= '20040321' then
dbms_output.put_line('success!');
end if;
fetch mycursor into date1;///////////////
end loop;
close mycursor;
end;