Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts
How we can Implement Update only in Incremental load ?
Note : Ignore Insert records (Perform only Update )
Thanks
Madhu
Hi madhu,
I thought the script I gave you was too long and could have been made shorter. It can and here it is:
OldDataSet:
Load
*,
Hash128(Key & '|' & Hours & '|' & Status) as HashKey;
Load * Inline [
Key, Hours, Status
100, 2, Completed
101, 3, Completed
102, 4, Pending];
NoConcatenate
ModifiedData:
Load
*
Where Exists(Key) and Not Exists(HashKey);
Load
*,
Hash128(Key & '|' & Hours & '|' & Status) as HashKey,
Key as ModKey;
Load * Inline [
Key, Hours, Status
100, 2, Completed
101, 3, Completed
102, 10, Completed
103, 5, Completed];
Drop Field HashKey;
NoConcatenate
NewDataSet:
Load * Resident OldDataSet Where Not Exists(ModKey, Key);
DROP Table OldDataSet;
Concatenate (NewDataSet)
LOAD Key, Hours, Status Resident ModifiedData;
DROP Table ModifiedData;