oracle中怎么判斷表是否存在

oracle中怎么判斷表是否存在

oracle判斷表是否存在的方法:

1、打開plsql客戶端,登錄oracle數(shù)據(jù)庫;

oracle中怎么判斷表是否存在

2、創(chuàng)建一個測試表,

create?table?test_exists(id?number,?value?varchar2(20));

oracle中怎么判斷表是否存在

3、編寫sql,插入oracle系統(tǒng)視圖,查詢剛建的表是否存在,

select?*?from?user_tables?t?where?table_name=?upper('test_exists');

可以看到有查詢結果,也就是說存在該表;

oracle中怎么判斷表是否存在

4、相反的,編寫sql,查詢test_exists2表是否存在,因沒有返回結果,則說明該表并不存在;

select?*?from?user_tables?t?where?table_name=?upper('test_exists2');

oracle中怎么判斷表是否存在

推薦教程: 《Oracle教程

以上就是

? 版權聲明
THE END
喜歡就支持一下吧
點贊15 分享