--
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 h2-database...@googlegroups.com.
To post to this group, send email to h2-da...@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.
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.
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.
Because PreparedStatement is "prepared" before the setLong method is called. Unfortunately, that's just how the API
works, at preparation time we don't have access to type information about the parameters and it has to be inferred.
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 could also try something like
delete from test
where big_number - ? < small_number * 1000