Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 354
chris Avatar asked Nov 01 '25 12:11

chris


1 Answers

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.

like image 142
Benoit Avatar answered Nov 04 '25 02:11

Benoit