I renamed field in table. When I do desc on this table it shows new name, However when I do SELECT newfieldname from mytable I get following error: ORA-00904.
Why!
Printable View
I renamed field in table. When I do desc on this table it shows new name, However when I do SELECT newfieldname from mytable I get following error: ORA-00904.
Why!
Does this query show your column name?
Do you have any miscellaneous characters around the new column name?
Post the results of this query.
Code:SELECT table_name, '|' || column_name || '|', data_type
FROM all_tab_columns
WHERE owner = 'SCHEMAOWNER' AND
table_name = 'YOURTABLE_NAME'
ORDER BY column_id;
When you renamed, did you put the new name in double quotes?
I run query below and could see my new column
code:--------------------------------------------------------------------------------
SELECT table_name, '|' || column_name || '|', data_type
FROM all_tab_columns
WHERE owner = 'SCHEMAOWNER' AND
table_name = 'YOURTABLE_NAME'
ORDER BY column_id;
Here is record with new column name
CUSTOMER_SITES |SITE_PRIM_DATA_SOURCE| CHAR
So what happens when you do this?
Code:SELECT SITE_PRIM_DATA_SOURCE
FROM CUSTOMER_SITES;
ORA-00904: invalid column name
Try posting the sql that you put in as well as all of the output.
There is probably something else that Oracle is telling you.
FYI
Quote:
tahiti.oracle.com
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.
I am using very simple test SQL
SELECT SITE_PRIM_DATA_SOURCE
FROM CUSTOMER_SITES
and error output ORA-00904: invalid column name
Howerver if I use old field name in my SQL it works and get result back. Does not make sence to me.
Thanks for looking at this for me!