Øystein Grøvlen wrote:
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.

--
Øystein


I feel the error message could be improved here:

ij> select * from t where bullyear=(acadyear-year+1);
ERROR 42X01: Syntax error: Encountered "year" at line 1, column 42.

It would be better if it was reported that "year" is a reserved word.

--
Øystein

Reply via email to