17,086
社区成员
发帖
与我相关
我的任务
分享
SQL> truncate table t_test_dml;
Table truncated
SQL> set serveroutput on
SQL>
SQL> declare
2 v_num number;
3 begin
4 select id into v_num from t_test_dml;
5 exception
6 when no_data_found then
7 begin
8 dbms_output.put_line('first');
9 select id into v_num from t_test_dml;
10 exception
11 when no_data_found then
12 dbms_output.put_line('second');
13 end;
14 end;
15 /
first
second
PL/SQL procedure successfully completed
SQL>