Thanks for further analysis Noel.

At the point in time that we evaluate the expression 
>     ? - small_number * 1000 
> the left side of the minus operation is unknown and the right side is int. 
>

How is it unknown? We're dealing with a PreparedStatement here, and 
PreparedStatement#setLong clearly indicates the type.

Also keep in mind that, as stated in the original comment and demonstrated 
in sample project, this statement executes just fine when there are no 
records in the table.
IMO the syntactic correctness of the expression in WHERE clause should not 
depend on the contents of the table.

You are going to have use to use CAST to hint that you want the expression 
> evaluated as BIGINT. 
>
> Since CAST is SQL-92 standard, I don't see a problem with this.
>

CAST is standard, however BIGINT is not.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to