Skip to content Skip to sidebar Skip to footer

A CREATE Statement With Quoted Fields In Oracle

I have created a table in Oracle 10g using the following CREATE statement. CREATE TABLE test ('id' NUMBER(35, 0) primary key, 'description' VARCHAR2(250) not null); The basic tabl

Solution 1:

OK, I won't say it, I'll just think it loudly.

The documentation clearly says that if you have quoted identifiers, you have to quote them everywhere (my italics for emphasis):

Every database object has a name. In a SQL statement, you represent the name of an object with a quoted identifier or a nonquoted identifier.

  • A quoted identifier begins and ends with double quotation marks ("). If you name a schema object using a quoted identifier, then you must use the double quotation marks whenever you refer to that object.

  • A nonquoted identifier is not surrounded by any punctuation.

So you always have to do:

SELECT "id", "description" FROM test;

Which is a pain. But obviously I'm just thinking that too, not really saying it.


Post a Comment for "A CREATE Statement With Quoted Fields In Oracle"