sql - Why does Oracle 12c query require double quotes around table -


this question has answer here:

the database i'm querying oracle 12c. detailed info database version follows:

oracle database 12c enterprise edition release 12.1.0.2.0 - 64bit production

pl/sql release 12.1.0.2.0 - production

i'm trying eliminate need have double quotes around every view or table in sql query.

following works (from oracle sql developer gui)

select m."metadata" "evmetadata" m 

following gives error (from oracle sql developer gui)

select m.metadata evmetadata m 

error is

ora-00942: table or view not exist 00942. 00000 - "table or view not exist" *cause:
*action: error @ line: 2 column: 6

i generated ddl, looks this

create table "evp"."evmetadata"   ("evmetadataid" number(10,0) generated identity minvalue 1 maxvalue 9999999999999999999999999999 increment 1 start 1 cache 20 noorder  nocycle ,   "insertdate" timestamp (6),   "sessionid" nvarchar2(17),   "filechecksum" nvarchar2(32),  "metadata" nclob,  "device" nvarchar2(20),  "user" nvarchar2(20) ) segment creation immediate  

so based on @toddlermenot's comment below, possible how table created - double quotes. used orm entity framework code first generate schema me seems orm puts double quotes default.

maybe created table double quotes? using double quotes preserve case , since table name has both upper , lower case letters in example, oracle able find when use double quotes.

without double quotes, oracle uses single case (upper?) irrespective of case might have in table, default.

for example: if create table using

create table "table_name" (blah..) 

then must use double quotes in select.

if create table using

create table table_name (blah..) 

the select without quote should work correctly. (it work quote if had letters of table's name in upper case)


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -