ibdknox/Korma — Issue #31: UPDATE doesn't work for H2 boolean columns
Author: bitsai
Created: 2011-12-09 03:54:37+00:00
State: open

When executing the following bit of code to update the ACTIVE column (a boolean column):

(update test-entity
(set-fields {:ACTIVE false})
(where {:APP_GUID "1234"}))

The following error is thrown:

Failure to execute query with SQL:
UPDATE test SET ACTIVE IS FALSE WHERE (test."APP_GUID" = ?) :: (1234)
JdbcSQLException:
Message: Syntax error in SQL statement "UPDATE TEST SET ACTIVE IS[*] FALSE WHERE (TEST.""APP_GUID"" = ?) "; expected "., ="; SQL statement:
UPDATE test SET ACTIVE IS FALSE WHERE (test."APP_GUID" = ?) [42001-161]
SQLState: 42001
Error Code: 42001

I think it's because for H2, "ACTIVE IS FALSE" needs to be replaced with "ACTIVE = FALSE". The following works correctly:

(exec-raw "update test set ACTIVE = false where (test.\"APP_GUID\" = '1234')")