views:

30

answers:

1

These is an existing table with column name "CLUSTER". I have to query this table to retrieve values of column "CLUSTER". I am getting missing expression error, since CLUSTER is a reserved word in Oracle. Since oracle has allowed to create a column by name CLUSTER, there should be way to retrieve the same. How can query for this column?

PS - I don't have an option to rename the column.

Thanks in advance.

+1  A: 

Just use double quotes to refer to that column, like:

select "CLUSTER" from table;

Also, make sure you match the case in the column name.

Vlad Lazarenko
This approach did not work for me. I made sure to match the case as well..
Mithun
@Mithun, look up the name of the column, e.g. by querying `ALL_TAB_COLUMNS`. That will give you the exact column name, including any embedded spaces and uppercase/lowercase letters.
Jeffrey Kemp