ORA 00904 Error:Invalid Identifier

Mistu4u picture Mistu4u · Jun 30, 2012 · Viewed 18.4k times · Source

I have installed Oracle 10g in my virtual XP and created a table using

create table reg1 (
  fname varchar2(30),
  lname varchar2(30),
  addr varchar2(30),
  mail varchar2(30),
  occu varchar2(30),
  uname varchar2(30),
  passwd varchar2(30)
);

and the table created successfully.But when I am trying to fetch the values by simple query like

select fname, lname 
  from reg1 
 where uname="bbb";

I am getting error like

ORA-00904: "bbb": invalid identifier

I cannot understand what I have done wrong here.

Answer

Andrew Leach picture Andrew Leach · Jun 30, 2012

Use single quotes.

select fname,lname from reg1 where uname='bbb';