views:

40

answers:

1

I have a table with a field named COMMENT, which appears to be a reserved word.

Using SQLDeveloper, if I try:

select
  [COMMENT],
  another_field
FROM table_created_by_idiot_developer

I get

SQL Error: ORA-00936: missing expression

How can I access this field in my select in SQL Developer? (Is this a problem with SQL Developer, or should field not be named COMMENT in oracle?)

+5  A: 

Try "COMMENT" instead of [COMMENT]. This is alternate syntax commonly accepted by various DBMSes. I have used this syntax to refer to columns having dots or UTF8 characters in their names in SQLite.

Benoit
More to the point, "..." is the correct syntax for delimiting an identifier in Oracle.
Jeffrey Kemp
Yes, `[]` is the true alternate syntax actually.
Benoit