[ 
https://issues.apache.org/jira/browse/DERBY-1623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12488848
 ] 

Andrew McIntyre commented on DERBY-1623:
----------------------------------------

Hi Manish,

SQL99 does list LEADING, TRAILING, and BOTH as reserved words. Also, I don't 
think that making them non-reserved keywords is going to be possible with the 
current parser implementation, since if you place them in the non-reserved 
list, you will necessarily get a conflict between the first token (in my 
suggestion, from ansiTrimType()) and the expansion of the non-optional token - 
in my example, characterValueExpression() - which can be a columnReference and 
thus just an identifier. The rule for identifiers currently includes the list 
of non-reserved keywords, which I suspect would lead to a conflict in any 
implementation which checks non-reserved keywords against identifiers. While 
there is a possibility for impact to existing applications, I'm wondering how 
serious the impact would be since the SQL99 standard has the keywords in 
question listed as reserved.

As for the case expression not working, it doesn't appear that SQL99 includes 
case expressions in <character value expression> or <character value function>, 
but it is very likely that I'm missing something in the spec. If such 
expressions in column references are allowed, and this is something other 
databases support, we should give it consideration.

I'd love to hear more feedback, and I'll dig some more into the standards to 
see what I can find.

> Add ANSI TRIM implementation
> ----------------------------
>
>                 Key: DERBY-1623
>                 URL: https://issues.apache.org/jira/browse/DERBY-1623
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>            Reporter: Emmanuel Bernard
>         Assigned To: Manish Khettry
>         Attachments: 1623-parser-guess.diff, AnsiTrimTest.java
>
>
> JPA is requiring databases to support this ANSI feature esp the ability to 
> chose the trimmed character
> TRIM([ [ LEADING | TRAILING | BOTH ] [ chars ] FROM ] str)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to