User_tables 甲骨文

User_tables Oracle

我在 Oracle 中创建了几个 table,但我无法使用例如查询

找到它们
select * from user_tables where table_name='temp';

但我确定 table 临时文件确实存在,我检查过了。

table 名称在 user_tables 中必须大写。

select * from user_tables where table_name='TEMP';

一个例子:

SQL> create table bogus (name varchar2(10));

Table created.

SQL> select table_name from user_Tables where table_name = 'bogus';

no rows selected

SQL> select table_name from user_Tables where table_name = 'BOGUS';

TABLE_NAME
------------------------------
BOGUS

*** 这是一个编辑,用于解释此答案的评论部分中所说的内容。简而言之,您可以在 Oracle 中创建 lower/mixed 个案例对象,但问题是每次引用它们时都必须将对象名称用双引号引起来。

一个例子

SQL> create table "bogus" (name varchar2(10));

Table created.

SQL> select table_name from user_tables where table_name = 'BOGUS';

no rows selected

SQL> select table_name from user_tables where table_name = 'bogus';

TABLE_NAME
------------------------------
bogus

SQL> select * from bogus;
select * from bogus
          *
ERROR at line 1:
ORA-00942: table or view does not exist


SQL> select * from "bogus";

no rows selected

SQL>

试试这个:

select * from user_tables where upper(table_name)=upper('temp');