Nogi Nogi - 1 year ago 89
SQL Question

SQL select with "" netbeans without ""

I'm trying to bind data from SQL table to JTable using netbeans, but my database is reacting only if select is written as

SELECT * FROM "table"
and netbeans is using
SELECT * FROM table without ""
, can you tell me how to change it in netbeans to use "" or in oracle SQL to don't need ""?

Answer Source

When you use double quotes and lower case, table name is case sensitive . If not, Oracle converts it to upper case, and makes it non case sensitive . For instance,

  create table "table1" (id int not null);
  select * from table1 ;  -- ORA-00942: table or view does not exist
  select * from TABLE1;  -- ORA-00942: table or view does not exist
  select * from "table1"; --ok

  create table table2 (id int not null); -- or TABLE2, or even "TABLE2"
  select * from table2 ; -- ok
  select * from TABLE2;  --ok
  select * from "TABLE2";  --ok

The same rule applied to other object names (such as fields, functions, procedures, packages, etc).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download