I see an error while executing hibernate sql query.
java.sql.SQLException: ORA-00904: "table_name"."column_name": invalid identifier
When I open up the table in sqldeveloper, the column is present.
The error is only happening in PROD, not in DEV.
What should I check?
Ora-00904 Error Message “Invalid Identifier” This error is most common when querying a SELECT statement. To resolve this error, first check to make sure the column name being referenced exists. If it does not exist, you must create one before attempting to execute an SQL statement with the column.
This error occurs when your column name not as same as you are writing in your query . and avoid to give column names which are Keyword of oracle , Group this cant be your column name or table name.
The plus sign is Oracle syntax for an outer join. There isn't a minus operator for joins. An outer join means return all rows from one table. Also return the rows from the outer joined where there's a match on the join key. If there's no matching row, return null.
The ambiguous column error message indicates that you have joined two (or more) columns in your query which share the same column name. The proper way to solve this is to give each table in the query an alias and then prefix all column references with the appropriate alias.
ORA-00904-invalid identifier
errors are frequently caused by case-sensitivity issues. Normally, Oracle tables and columns are not case sensitive and cannot contain punctuation marks and spaces. But if you use double quotes to create a quoted identifier, that identifier must always be referenced with double quotes and with the correct case. For example:
create table bad_design("goodLuckSelectingThisColumn " number);
Oracle will throw ORA-00904
if executing user does not have proper permissions on objects involved in the query.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With