Hi,
on R12.2 on linux,
The following code stops because a select statement returns no rows.
Effectivly this select (on line 17)returns no row:
select col1 from T where col1=5;
How can bypass it and make it continu?
Here is the code:
DECLARE
n T.col1%type;
n2 T.col1%type;
cursor mycur is
select col1 from T;
BEGIN
OPEN mycur;
LOOP
FETCH mycur into n;
EXIT WHEN mycur%notfound;
CASE n
when 1 then
select col1 into n2 from T where col1=1;
dbms\_output.put\_line('N IS : '||n);
select col1 into n2 from T where col1=5;
dbms\_output.put\_line(' Again N IS : '||n);
when 7 then
select col1 into n2 from T where col1=1;
dbms\_output.put\_line('N IS :'||n );
else dbms_output.put_line('N IS NOTHING :' );
END CASE;
END LOOP;
CLOSE mycur;
END;
ORA-01403: no data found ORA-06512: at line 17
Thanks.
PS:
create table T (col1 varchar2(10));
insert into T values(1);
insert into T values(2);
insert into T values(3);
