请教高手!
各位大虾,这段代码有啥错误?为啥总出现ORA-06510: PL/SQL: unhandled user-defined exception?
declare
name1 varchar2(20);
birthday date;
id1 number(3):=3;
more_than_one_row exception;
begin
while id1>=0 loop
select name into name1 from pltable where id=id1;
if name1<>' ' then
dbms_output.put_line('name is: '||name1);
end if;
select birthday into birthday from pltable where name=name1;
if birthday is not null then
dbms_output.put_line(' birthday is: '||to_char(birthday,'dd-mm-yyyy'));
end if;
id1:=id1-1;
end loop;
exception
when no_data_found then
dbms_output.put_line('no data found!');
when too_many_rows then
raise more_than_one_row;
when more_than_one_row then
dbms_output.put_line('more than one row!');
when others then
dbms_output.put_line('unknown error!') ;
end;
|