Oracle ORA-00942: table or view does not exist when it exists

Thou picture Thou · Apr 19, 2018 · Viewed 12.9k times · Source

I'm trying to get used to Oracle, installed express one and created by 3rd part program some tables. And when I log in into sqlplus I can not simply use SELECT * FROM table....

SQL> SELECT * FROM tab;

TNAME                          TABTYPE  CLUSTERID
------------------------------ ------- ----------
ZIP                            TABLE
Country                        TABLE
City                           TABLE

But when I try to select all it runs:

SQL> SELECT * FROM Country;
SELECT * FROM Country
              *
ERROR at line 1:
ORA-00942: table or view does not exist

And I have no idea why...

Answer

Littlefoot picture Littlefoot · Apr 19, 2018

It seems that case matters. What is the result of

select * from "Country";

It appears that someone created table using double quotes and mixed case (which is - in Oracle - a bad idea because you'll always have to reference it using double quotes and never fail in correctly spelling it.