declare
v_isexist number(3,0):=0;
begin
select count(1) into v_isexist from sys.all_objects where owner = 'TEST' and object_type = 'TABLE' and object_name = 'TAB1';
if v_isexist>0 then
dbms_output.put_line('exists');
else
dbms_output.put_line('not exists');
end if;
end;
oracle判断对象是否存在
检查表是否存在
最新推荐文章于 2024-01-24 16:50:23 发布
本文提供了一个PL/SQL过程示例,用于检查Oracle数据库中名为'TAB1'的表是否存在。通过查询SYS.ALL_OBJECTS视图并使用IF语句来判断表是否存在,并通过DBMS_OUTPUT输出结果。
954

被折叠的 条评论
为什么被折叠?



