I need to update a table column with values that are derieved. To add little more complexity, I need to concat a value based on the derivate and hence the value to append for concat is not always the same. I came up with this query, but it apparently has a problem executing.
update TRANSFER set PROCESS_STATUS = concat ( PREDICATE ,
(select dom_value from DOMAIN_VALUES dv where dv.val_id = st.sr_cashflow_status
CASE PREDICATE WHEN dv.dom_value = 'ZZZZ' THEN 'SPB'
WHEN dv.dom_value = 'XXXX' THEN 'SPB'
WHEN dv.dom_value = 'YYYY' THEN 'SPB'
ELSE 'DPS'
END )) from TRANSFER st
where PROCESS_STATUS is null;
My main problem is that how do I maintain the appender (here, predicate) as dynamic value that can be checked on the value obtained by join?
Any answers/directions much appreciated.