SQL> set serveroutput on
SQL>
SQL> declare
2 v_count number;
3 begin
4 select count(*) into v_count from access$;
5 if v_count=0 then
6 select 1 into v_count from dual;
7 end if;
8 dbms_output.put_line(v_count);
9 end;
10
11 /
73017
PL/SQL procedure successfully completed
SQL>
SQL> declare
2 v_count number;
3 begin
4 select count(*) into v_count from access$;
5 if v_count=0 then
6 select 1 into v_count from dual;
7 end if;
8 dbms_output.put_line(v_count);
9 end;
10
11 /
73017
PL/SQL procedure successfully completed
還有是pl/sql,不是ql/spl
统计行数!