sqloracle-databaseoracle-sqldeveloperora-00936

Oracle: Handling a field named COMMENT


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?)


Solution

  • 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.