I want to update a new column on one of my tables but I'm not sure how to go about this.
The new column is MARITAL_STATUS and is on the SCV_CLEINT_DETAILS table. The values for this table will be generated from various sources and this query below gets me the values I'm looking for:
SELECT scd.qsclient_id,
scd.system_client_id,
NVL(c.paxus_client_id, c.client_id),
UPPER(NVL(NVL2(c.paxus_client_id, pc.clt_mar_stat, c.maritial_status_code), decode(c.client_type_id, '2000001702', 'C', 'U'))) AS NewMarStatus,
scd.marital_status
FROM scv_client_details scd, client c, paxus_client pc
WHERE scd.system_client_id = to_char(c.client_id)
AND c.paxus_client_id = pc.client(+)
AND UPPER(scd.SYSTEM_INDICATOR) = 'WRITEN'
AND (scd.marital_status <> UPPER(NVL(NVL2(c.paxus_client_id, pc.clt_mar_stat, c.maritial_status_code), decode(c.client_type_id, '2000001702', 'C', 'U'))) OR
scd.marital_status IS NULL)
I would like to update the new MARITAL_STATUS column with the value generated in the NewMarStatus above. I really don't know how to write the update statement though.
Any help really appreciated.