国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數據庫 > Oracle > 正文

oracle刪除已存在的表的實例

2024-08-29 13:55:38
字體:
來源:轉載
供稿:網友
Sql代碼

復制代碼 代碼如下:


select count(*) from user_objects where object_name=upper(p_table_name);
select count(*) from user_tables where table_name=upper(p_table_name);

create or replace procedure p_drop_table_if_exist_v1(
p_table_name in varchar2
) is
v_count number(10);
begin
select count(*)
into v_count
from user_objects
where object_name=upper(p_table_name);
if v_count > 0 then
execute immediate 'drop table ' || p_table_name || ' purge';
end if;
exception
when no_data_found then
begin
null;
end;
end;
/

create or replace procedure p_drop_table_if_exist_v2(
p_table_name in varchar2
) is
v_table_name varchar2(20);
begin
select table_name
into v_table_name
from user_tables
where table_name=upper(p_table_name);
if length(v_table_name)>0 then
execute immediate 'drop table ' || p_table_name || ' cascade constraints';
end if;

exception
when no_data_found then
begin
null;
end;
end;
/

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 宁城县| 长子县| 浦东新区| 化州市| 博乐市| 澄城县| 平原县| 贵溪市| 永胜县| 大荔县| 蒙城县| 利辛县| 巴青县| 泰兴市| 娄烦县| 通辽市| 玛曲县| 清水河县| 习水县| 金华市| 阿拉善左旗| 桃江县| 拜城县| 兰溪市| 获嘉县| 玉田县| 蓬莱市| 湘乡市| 南开区| 柳州市| 拉孜县| 镇赉县| 永登县| 深水埗区| 望城县| 桐乡市| 灵寿县| 方正县| 靖安县| 高安市| 崇州市|