Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-00904: invalid identifier newbie, valid field is 'invalid'

775094May 25 2010 — edited May 25 2010
Why can't I use the sha field (it is primary key)? Here I insert a record, and then select it, says my field is invalid? Its not!
Database has 1 billion entires in it...

SQL> describe hash_table;
Name Null? Type
----------------------------------------- -------- ----------------------------
sha NOT NULL VARCHAR2(64)
file_name NOT NULL VARCHAR2(20 CHAR)
offset BINARY_DOUBLE
length NUMBER(38)
ref_count NUMBER(38)

SQL> insert into hash_table values('3','/zpool1/data2/1',10,4096,1);

1 row created.

SQL> select * from hash_table where sha = '3';
select * from hash_table where sha = '3'
*
ERROR at line 1:
ORA-00904: "SHA": invalid identifier

SQL> select * from hash_table where sha = 3;
select * from hash_table where sha = 3
*
ERROR at line 1:
ORA-00904: "SHA": invalid identifier

SQL> select * from hash_table where 'sha' = 3;
select * from hash_table where 'sha' = 3
*
ERROR at line 1:
ORA-01722: invalid number


SQL> select * from hash_table where 'sha' = '3';

no rows selected

Edited by: user12613973 on May 25, 2010 8:12 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 22 2010
Added on May 25 2010
2 comments
1,083 views