I need to be able to MLOAD into a table and during the MLOAD processing to determine whether the current row is the newest row in a grouping of history records already in the table and if it is to mark it. I can run a query to update records older than the current record and younger than the current record but I currently cannot tell at processing time where the current record falls into. I am trying to use this SQL but am getting the message 3538: A MultiLoad Update Statement is Invalid.... which I figure is to complicated for MLOAD. Any Ideas?
Thanks,
Michael
.DML LABEL UPDATE_DML_3
IGNORE MISSING UPDATE ROWS;
UPDATE &DBASE_TARGETTABLE..&TARGETTABLE
SET PROCESS_CD = 'LATEST AND GREATEST'
WHERE
s_id = :s_id and
s_i_id = :s_i_id and
o_dt = CASTo_dt AS TIMESTAMP(0)) and
o_dt IN
(
SELECT max(o_dt) from &DBASE_TARGETTABLE..&TARGETTABLE
WHERE s_id = :s_id and
s_i_id = :s_i_id
);
Thanks,
Michael
.DML LABEL UPDATE_DML_3
IGNORE MISSING UPDATE ROWS;
UPDATE &DBASE_TARGETTABLE..&TARGETTABLE
SET PROCESS_CD = 'LATEST AND GREATEST'
WHERE
s_id = :s_id and
s_i_id = :s_i_id and
o_dt = CASTo_dt AS TIMESTAMP(0)) and
o_dt IN
(
SELECT max(o_dt) from &DBASE_TARGETTABLE..&TARGETTABLE
WHERE s_id = :s_id and
s_i_id = :s_i_id
);