Hi,

"Cédric Gérard (JIRA)" <[email protected]> writes:

> ij version 10.1
> ij> connect 'jdbc:derby://localhost:1528/watDB_v2';
> ij> SELECT ID_ITM, ITM_CODE FROM ITEMS WHERE ITM_CODE = COALESCE(NULL, 
> ITM_CODE);
> ERROR 42X01: Syntax error: Encountered "NULL" at line 1, column 62.

The "NULL" literal here is not legal SQL, you need to cast the value
as in your next example.

> ij> SELECT ID_ITM, ITM_CODE FROM ITEMS WHERE ITM_CODE = COALESCE(CAST(NULL AS 
> BIGINT), ITM_CODE);
> ID_ITM              |ITM_CODE
> ---------------------------------------------
> ERROR 38000: The exception 'java.lang.NullPointerException' was thrown while 
> evaluating an expression. SQLSTATE: XJ001:
> Java exception: ': java.lang.NullPointerException'.

I tried this on trunk and it works for me. It may be that this has
been corrected already. Are you able to try it with the 10.2 release
candidate? You can find it here:
http://people.apache.org/~rhillegas/10.2.1.5/

Dag

Reply via email to