declare v_cnt Number;
begin
select count(*) into v_cnt from user_tables where table_name = TABLENAME;
if v_cnt>0 then
dbms_output.put_line('该表存在!');
else
dbms_output.put_line('该表不存在或当前用户无权访问!');
end If;
End;
注意:表名要大写,在这里是区分大小写的。Oracle创建的表名全是大写。
写于 2010-10-15