ORA-00904: invalid column name
DBAsupport.com Forums - Powered by vBulletin
Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: ORA-00904: invalid column name

  1. #1
    Join Date
    Nov 2000
    Posts
    57

    ORA-00904: invalid column name

    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!

  2. #2
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    3,997
    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;
    Last edited by gandolf989; 10-07-2004 at 10:24 AM.

  3. #3
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    When you renamed, did you put the new name in double quotes?

  4. #4
    Join Date
    Nov 2000
    Posts
    57
    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;

  5. #5
    Join Date
    Nov 2000
    Posts
    57
    Here is record with new column name

    CUSTOMER_SITES |SITE_PRIM_DATA_SOURCE| CHAR

  6. #6
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    3,997
    So what happens when you do this?

    Code:
    SELECT SITE_PRIM_DATA_SOURCE 
      FROM CUSTOMER_SITES;

  7. #7
    Join Date
    Nov 2000
    Posts
    57
    ORA-00904: invalid column name

  8. #8
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    3,997
    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.

  9. #9
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    3,997
    FYI

    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.

  10. #10
    Join Date
    Nov 2000
    Posts
    57
    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width