CASE expression in Groovy SQL
18:50 01 Jun 2012

I have some Groovy code that calls the groovy SQL object:

Sql sql = new Sql(dataSource)
sql.execute(insert)

It has worked fine in the past, but I now have some conditional logic that I tried to model with a CASE expression like CASE WHEN a.pick = ${somevalue} THEN ${100} ELSE 0 END CASE"

However, I get a runtime error that says it doesn't recognize a, but I believe it to be a symptom of the fact that it doesn't recognize the CASE expression in general, as a is recognized elsewhere in the query and is nothing new. How can I accomplish this?

mysql sql grails groovy