简体   繁体   English

java.sql.SQLSyntaxErrorException:ORA-00904:“columnName”:无效标识符

[英]java.sql.SQLSyntaxErrorException: ORA-00904: “columnName”: invalid identifier

when I open SQL developer same column is exists with the exact same name.当我打开 SQL 开发人员时,相同的列以完全相同的名称存在。 And it's happening in some of UAT and prod DB but working in some UAT database.它发生在一些 UAT 和 prod DB 中,但在一些 UAT 数据库中工作。

Please help me请帮我

Also please explain the difference between the following exception另请解释以下异常之间的区别

  1. ORA-00904: "columnName": invalid identifier ORA-00904: "columnName": 无效的标识符
  2. ORA-00904: "tableName"."columnName": invalid identifier ORA-00904: "tableName"."columnName": 标识符无效

Mind letter case.介意信箱。

By default, names of all objects in Oracle are stored in uppercase, but you can reference them using any case you want.默认情况下,Oracle 中所有对象的名称都以大写形式存储,但您可以使用任何大小写来引用它们。 For example:例如:

SQL> create table test (id number);

Table created.

SQL> insert into test (ID) values (1);

1 row created.

SQL> select iD from TeST;

        ID
----------
         1

SQL> select ID from test;

        ID
----------
         1

But, if you used double quotes and mixed case, then you have to use double quotes and exactly the same letter case, always:但是,如果你使用双引号和混合大小写,那么你必须使用双引号和完全相同的字母大小写,总是:

SQL> create table "Test" ("iD" number);

Table created.

SQL> insert into test (id) values (1);
insert into test (id) values (1)
            *
ERROR at line 1:
ORA-00942: table or view does not exist


SQL> insert into "Test" (ID) values (1);
insert into "Test" (ID) values (1)
                    *
ERROR at line 1:
ORA-00904: "ID": invalid identifier


SQL> insert into "Test" ("ID") values (1);
insert into "Test" ("ID") values (1)
                    *
ERROR at line 1:
ORA-00904: "ID": invalid identifier


SQL> insert into "Test" ("iD") values (1);

1 row created.

SQL>

As of two errors you posted: they are the same.从您发布的两个错误开始:它们是相同的。 The only difference is that the 2nd shows owner (schema) name along with column name.唯一的区别是第二个显示所有者(模式)名称和列名。 Note that it is NOT database name (as "DB_Name" suggests);请注意,它不是数据库名称(如“DB_Name”所示); in Oracle, database is something different.在 Oracle 中,数据库有所不同。 If you're trying to make a relation between Oracle and some other DBMS', then what is a "database" there is "user" (or "schema") in Oracle.如果您试图在 Oracle 和其他一些 DBMS 之间建立关系,那么 Oracle 中“用户”(或“模式”)是什么“数据库”。

Apart from that, no difference.除此之外,没有区别。 ORA-00904 means that you're referencing a column which doesn't exist in that table. ORA-00904表示您正在引用该表中不存在的列。 Again: mind letter case.再次:介意字母大小写。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java.sql.SQLSyntaxErrorException:ORA-00904::无效的标识符 - java.sql.SQLSyntaxErrorException: ORA-00904: : invalid identifier getParameterMetaData()抛出java.sql.SQLSyntaxErrorException:ORA-00904:“ F”:无效标识符 - getParameterMetaData() throws java.sql.SQLSyntaxErrorException: ORA-00904: “F”: invalid identifier PL / SQL JAVA ORACLE ERROR ORA-00904:无效标识符 - PL/SQL JAVA ORACLE ERROR ORA-00904: INVALID IDENTIFIER java.sql.SQLSyntaxErrorException:ORA-00972:标识符太长 - java.sql.SQLSyntaxErrorException: ORA-00972: identifier is too long INFO:服务器在1054 ms java.sql.SQLException中启动:ORA-00904:“ USHA”:无效的标识符 - INFO: Server startup in 1054 ms java.sql.SQLException: ORA-00904: “USHA”: invalid identifier 为什么我越来越<java.sql.SQLException: ORA-00904: "PASSWORD": invalid identifier> - Why am I getting <java.sql.SQLException: ORA-00904: "PASSWORD": invalid identifier> java.sql.SQLSyntaxErrorException:ORA-00911:无效字符 - java.sql.SQLSyntaxErrorException: ORA-00911: invalid character java.sql.SQLSyntaxErrorException:ORA-00903:表名无效 - java.sql.SQLSyntaxErrorException: ORA-00903: invalid table name 错误 --&gt; java.sql.SQLSyntaxErrorException: ORA-01722: 无效号码 - ERROR --> java.sql.SQLSyntaxErrorException: ORA-01722: invalid number java.sql.SQLSyntaxErrorException:ORA-00922:缺少或无效的选项 - java.sql.SQLSyntaxErrorException: ORA-00922: missing or invalid option
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM