AnsweredAssumed Answered

SQL Query returning Null update statement fails

Question asked by Plidian on Oct 5, 2011
Latest reply on Apr 26, 2013 by Viraj Khara
I've got a Gel script that I'm running in the clarity Application. It pulls out values and does comparisons in order to set a High medium Low attribute on a sub-object of the Project Object.
The problem I'm having is that when the query returns a null GEL appears to be storing no value in the variable, rather than storing null.
This causes a problem when I go to do my update

<sql:update dataSource="${clarityDS}">
update odf_ca_aoc_biweekstatusrpt set aoc_schedule_status=${do_app.rows[0].schedule}, aoc_scope_status=${do_app.rows[0].scope}, aoc_budget_status=${do_app.rows[0].budget}, aoc_risk_rating=${do_app.rows[0].risk}
where id=${gel_objectInstanceId}


If the risk value, for example, is blank then when the SQL updates it looks like this

update odf_ca_aoc_biweekstatusrpt set aoc_schedule=10, aoc_scope_status=20, aoc_budget_status=10, aoc_risk_rating=
where ID=5000234

The desired result is to have it leave the null that is in the database or even populate the existing value with null. unfortunately the above SQL generates a syntax error when parsed by MSSQL2008.
Blank is not the same as null.
Seems like this should be a simple solution but my searches have yielded nothing valuable.