|
Update only when value is not null (or “” or 0) Hi there, I try to make iBatis do a update only if the propertie in my
object contains data How do I do this? Example, I’m receiving a XML file that may contain some column
values that need to get updated: <employees xmlns='http://openuri.org/empschema'
company='1'> <employee> <Code>852</Code> <Surname> <EmplName> </employee> </employees> I parse this into an employee object and get this through to
my update statement; <update id="updateEmployeeDirect"
parameterClass="xmlemployee"> UPDATE EmplMain SET Surname = #surname#,
EmplName = #emplName#, Nickname = #nickname#, …… ucEMPassword = #ucEMPassword# WHERE Code = #code# </update> This will not work because it is attempting to store null
values, and even if it worked it would override my data! So I would like to do something like SET Surname = IIF(#surname#
is null, Surname, #surname#) Can this be done? -- |
- Re: Update only when value is not null Meindert
- Re: Update only when value is not null Larry Meadors

