Database Reference
In-Depth Information
The name must begin with a letter and must use only letters,
numbers, or these three symbols: $, #, _ (unless enclosed in dou-
ble quotes).
If enclosed in double quotes, a column name is case sensitive and can
begin with any character and include any letter, number, or symbol, includ-
ing a space character. For instance, if a column is created as double quote
enclosed and containing lowercase letters, then when selecting that named
column from a table, double quotes must be used. This first example shown
will cause an error (ORA-00904: invalid column name):
SELECT Column_xyz FROM MYTABLE;
You must add the double quotes like this to avoid an error:
SELECT "Column_xyz" FROM MYTABLE;
Let's look at another example to make this point clearer and create a
table containing three different columns. The table is described using the
DESC command in Figure 3.3. The column called A appears as A, b
appears as B, “abc” is lowercase abc, and “a b c” is a b c.
CREATE TABLE TMP (A NUMBER, b NUMBER, "abc" NUMBER, "a b c"
NUMBER);
Figure 3.3
Table Column
Names and Double
Quotes (").
Search WWH ::




Custom Search