您的位置:首页 > 其它

检查表是否存在

2015-11-23 16:42 323 查看
--检查表是否存在
function is_tab_exist(v_tab_name varchar2,v_dblink_name varchar2 default null) return boolean
as
n_count number default 0;
b_result boolean default false;
begin
--在用户表中查询
execute immediate 'select count(1) from user_tables'||case when v_dblink_name is not null then '@'||v_dblink_name end||' where table_name=upper('''||v_tab_name||''')' into n_count;
if n_count > 0 then
b_result := true;
end if;
return b_result;
exception
when others then return false;
end is_tab_exist;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: