declare
v_ename emp.ename%type;
begin
select ename into v_ename from emp where empno=&no;
dbms_output.put_line('name:'||v_ename);
exception
when no_data_found then
dbms_output.put_line('没有该编号!');
end;
自定义例外:
myex exception;
--表示没有update
if sql%notfound then
--触发myex;
raise myse;
when myex then
dbms_outpot.put_line('没有更新任何用户.');
end if;
v_ename emp.ename%type;
begin
select ename into v_ename from emp where empno=&no;
dbms_output.put_line('name:'||v_ename);
exception
when no_data_found then
dbms_output.put_line('没有该编号!');
end;
自定义例外:
myex exception;
--表示没有update
if sql%notfound then
--触发myex;
raise myse;
when myex then
dbms_outpot.put_line('没有更新任何用户.');
end if;