检查某个表是否存在?
1.当前用户下是否有某个表
select count(*) from user_tables where table_name = 'TABLE_NAME';
注意,一般情况下,引号里面的table_name要全部用大写。
如果结果为1,表示有这个表,为0表示没有这个表。
2.某个用户下是否有某个表?
select count(*) from dba_tables where owner = 'USER_NAME' and table_name = 'TABLE_NAME';
注:用户名与表名大写
posted on 2010-05-26 16:16 kisstome88 阅读(189) 评论(0) 编辑 收藏 举报