Handle Column or Function Name Incompatibilities
Many keywords from the SQL 2003 standard are now considered reserved words for
RAQL.
See RAQL
Reserved Keywords for a complete list.Column or function names that match any of these reserved words, regardless of case, will cause errors in query execution. To avoid errors, you must enclose these conflicting names in quote marks.
In the following example, one column name conflicts with the date reserved word and must be quoted:
select company, item, "date", quantity from dailySales
Or this example, where the built-in month function must be quoted:
select symbol, open, close, "month"(quote_date) as quoted from stocks
Names may also include invalid characters such as periods, dashes or other punctuation characters. Enclosing them in quotes prevents query execution errors, such as this example:
select "current.balance" as curbal, "prev.balance" as prevbal from accounts
Several of the built-in RAQL functions from the previous release now have name conflicts with reserved words, particularly those dealing with components in dates and times. You can update queries to enclose these functions in quotes, as shown previously. Or you can use the newly recommended functions that have no conflicts such as:
select symbol, open, close, extract_month(quote_date) as quoted from stocks
The recommended functions that are available in this release for date/time built-in functions includes:
3.6 Function | 3.7 Recommended Function |
date | extract_date |
day | extract_day |
hour | extract_hour |
minute | extract_minute |
month | extract_month |
second | extract_second |
week | extract_week |
year | extract_year |