Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   Other Syntax Segments > Identifier >

Using INTERVAL or DATETIME as a Column Name

The examples in this section show workarounds for using the keyword INTERVAL (or DATETIME) as a column name in a SELECT statement.

Using interval as a column name causes the following example to fail because the database server interprets interval as a keyword and expects it to be followed by an INTERVAL qualifier:

SELECT interval FROM mytab; -- fails 

If the DELIMIDENT environment variable is set, you could use interval as a column name, as the following example shows:

SELECT "interval" from mytab; -- successful

The workaround in the following example removes ambiguity by specifying a table name with the column name:

SELECT mytab.interval FROM mytab;

The workaround in the following example includes an owner name with the table name:

SELECT josh.mytab.interval FROM josh.mytab;
Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]