ORA-00904 : string : invalid identifier
ORA-00904 is a simple error to fix and occurs when an invalid column name is specified in the query or the program being developed. Many times the invalid identifier is also due to the wrong usage of an alias in a query. To fix the ORA-00904 error you should understand a few rules in naming and referring to the columns in an Oracle table.
ORA-00904:string: invalid identifier
Cause: The column name entered is either missing or invalid.
Action: Enter a valid column name. A valid column name must begin with a letter, be less than or equal to 30 characters, and consist of only alphanumeric characters and the special characters $, _, and #. If it contains other characters, then it must be enclosed in double quotation marks. It may not be a reserved word.
1. User executes a query with wrong column name : We have seen this error happens when the user misspells a column name in a query. Check the names of the columns referenced in your query
2. User uses an incorrect alias of the table in the query to avoid ORA-00904 : If you are using table aliases, please validate that all column names have been appropriately aliased and the correct alias is being used in front of each column being referenced in the query.
3. Follow the rules in naming the column to avoid ORA-00904 : A column name must begin with a letter, be less than 30 characters, consist of alphanumeric and special characters ($_#). If you want to violate any of these rules and still avoid a ORA-00904, you should specify the columnname with double quotes.
4. Some issues related to ORA-00904 have been attributed to incorrect setup of an Oracle database. While this is very uncommon, you should validate if the catproc.sql script has been executed properly and ask your admin to run this if its a new database thats throwing the error continously.
Last edited by oracle-dba; 05-14-2011 at 06:51 AM.