declare n_found integer; begin select count(*) into n_found from user_tables where table_name='表名'; if n_found>0 then dbms_output.put_line('have'); else dbms_output.put_line('no'); end if; end;
更正一下 declare n_found integer; begin select nvl(count(*),0) into n_found from user_tables where table_name='CLASS'; if n_found>0 then dbms_output.put_line('have'); else dbms_output.put_line('no'); end if; end;
n_found integer;
begin
select count(*) into n_found from user_tables where table_name='表名';
if n_found>0 then
dbms_output.put_line('have');
else
dbms_output.put_line('no');
end if;
end;
declare
n_found integer;
begin
select nvl(count(*),0) into n_found from user_tables where table_name='CLASS';
if n_found>0 then
dbms_output.put_line('have');
else
dbms_output.put_line('no');
end if;
end;