[EMAIL PROTECTED] wrote:


The words I am putting into the SQLite language spec are
shown below.  Please tell me if you thing my understanding
is correct:

  The COLLATE operator can be throught of as a unary
  postfix operator.  The COLLATE operator has the highest
  precedence.  It always binds more tightly than any
  unary prefix operator or any binary operator.


That sounds right to me, and seems to match the grammar I posted earlier for a string value expression.

You might need to be careful about the binding of the unary plus operator which you use to disable indexes. In an expression like this:

   +col1 COLLATE NOCASE

you may want The + to bind to the col1 first and then bind the collation to that expression. i.e.

   (+col1) COLLATE NOCASE

rather than

   +(col1 COLLATE NOCASE)


I'm wading through the standard grammar to see if there are other areas that may be of concern. So far the collate clause can optionally be applied to any <character primary>, which can be a string valued function, a parenthesized expression, or one of many <value expression primaries> which I think will reduce to a column reference, subquery, case statement, or a cast in SQLite.

<string value expression> ::=
       <character value expression>
       | <bit value expression>
       | <blob value expression>

<character value expression> ::=
       <concatenation>
       | <character factor>

<concatenation> ::=
<character value expression> <concatenation operator> <character factor>

<character factor> ::=
       <character primary> [ <collate clause> ]

<character primary> ::=
       <value expression primary>
       | <string value function>

<value expression primary> ::=
       <parenthesized value expression>
       | <nonparenthesized value expression primary>

<parenthesized value expression> ::=
       <left paren> <value expression> <right paren>

<nonparenthesized value expression primary> ::=
       <unsigned value specification>
       | <column reference>
       | <set function specification>
       | <scalar subquery>
       | <case expression>
       | <cast specification>
       | <subtype treatment>
       | <attribute or method reference>
       | <reference resolution>
       | <collection value constructor>
       | <routine invocation>
       | <field reference>
       | <element reference>
       | <method invocation>
       | <static method invocation>
       | <new specification>

Dennis Cote

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to