你指的是这样? declare v_temp varchar2(30); begin select col1 into v_temp from table where condition..; dbms_output.put_line('find the result'); exception when no_data_found then dbms_output.put_line('that is no data'); end;
declare v_temp varchar2(30); begin select max(col1) into v_temp from table where condition..; if v_temp is null then begin -----你要做什么 end; else begin ---你要做什么 end ; end if; end;
declare
v_temp varchar2(30);
begin
select col1 into v_temp from table where condition..;
dbms_output.put_line('find the result');
exception
when no_data_found then
dbms_output.put_line('that is no data');
end;
v_temp varchar2(30);
begin
select max(col1) into v_temp from table where condition..;
if v_temp is null then
begin
-----你要做什么
end;
else
begin
---你要做什么
end ;
end if;
end;