4

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...

Thou
  • 1,055
  • 3
  • 11
  • 16
  • 1
    When you use the 3rd party program then enter the table name in UPPER CASE. It will enter the identifier into the data dictionary in the default case Oracle uses and you should be able to use unquoted identifiers (without any need to enforce case sensitivity through the use of double quotes) to reference the table. – MT0 Apr 19 '18 at 07:36
  • Genious :) It's working. – Thou Apr 19 '18 at 07:39

1 Answers1

8

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.

Littlefoot
  • 131,892
  • 15
  • 35
  • 57
  • Fast one :O Solved it. I guess the problem was trivial but I wouldn't guess that program creates tables with double quotes. – Thou Apr 19 '18 at 06:56
  • Right; it's a mystery why some people make their (and our) lives more complicated than they should be. – Littlefoot Apr 19 '18 at 06:59