【Oracle字典表应用】利用字典表查表是否存在

【Oracle SQL】

一行流方式:

select count(*) from all_tables where table_name=upper('your tableName')

层次化方式:

select count(*) 
from all_tables 
where table_name=upper('your tableName')

 

【PG SQL】

一行流方式:

select count(*) from information_schema.table where table_schema='your schema' and table_type='BASE TABLE' and upper(table_name)=upper('your tableName')

层次化方式:

select count(*) 
from information_schema.table 
where 
table_schema='your schema' and 
table_type='BASE TABLE' and 
upper(table_name)=upper('your tableName')

END

posted @ 2022-08-19 04:45  逆火狂飙  阅读(31)  评论(0)    收藏  举报
生当作人杰 死亦为鬼雄 至今思项羽 不肯过江东