主頁 > 知識庫 > oracle刪除已存在的表的實例

oracle刪除已存在的表的實例

熱門標(biāo)簽:溫州人工外呼系統(tǒng) 地圖標(biāo)注付款了怎么找不到了 百度地圖標(biāo)注員是干什么 貴陽智能電銷機器人官網(wǎng) 沈陽400電話是如何辦理 北京營銷外呼系統(tǒng)廠家 外呼系統(tǒng)口號 外呼系統(tǒng)鄭州 北京外呼系統(tǒng)公司排名
Sql代碼
復(fù)制代碼 代碼如下:

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; 
/  

標(biāo)簽:衢州 潮州 溫州 衡水 淮北 包頭 通遼 定西

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《oracle刪除已存在的表的實例》,本文關(guān)鍵詞  oracle,刪除,已,存,在的,表,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《oracle刪除已存在的表的實例》相關(guān)的同類信息!
  • 本頁收集關(guān)于oracle刪除已存在的表的實例的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章