db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <Knut.Hat...@Sun.COM>
Subject Re: Problem with valueSpecification() grammar rule
Date Mon, 29 Oct 2007 12:18:03 GMT
Øystein Grøvlen <Oystein.Grovlen@Sun.COM> writes:

> Dhananjay Muli wrote:
>> Hello,
>>     I am facing problem with a query in postgresql having following
>> condition in where clause
>>
>> bullyear=(acadyear-year+1)
>>
>> where acadyear, bullyear and year are columns of table. The existing
>> sqlgrammar.jj file has a problem parsing the 'year' token occurence
>> after the '-' sign. It expects a literal value there. The exception
>> while parsing the query is given at the end. I modified
>> valueSpecification() rule to add a new rule (the first one in the
>> two rules given below) so that grammar should also allow column
>> reference along with literal values.
>>
>
> Maybe your problem is that YEAR is a reserved word in Derby.  Hence,
> it should not be used for the name of a column.  However, it seems
> strange that you have been able to use a reserved word for the name of
> a column.

I think it works if you quote the column name:

  bullyear=(acadyear-"YEAR"+1)

-- 
Knut Anders

Mime
View raw message