Simultaneous Read and Write to a DB2 Table
Posted: Wed Aug 16, 2006 1:25 am
I have a requirement to do simultaneous read and write to a DB2 table.
I need to lookup a DB2 table, if a value is not found in the lookup, compute a new value and update the lookup table so that all subsequent input rows with same key will use the same value from lookup table.
The steps I am doing is:
Read Input
For every input record
Lookup DB2 Table for the value
If Value is found
Write to Output
Else
Compute the random value
Write to Db2 Lookup Table
Write to Output
end If
end For
Probably in Server job we can do this using Hash files, but in Parallel job I am not able to implement this using a DB2 Stage. Please Help.
I need to lookup a DB2 table, if a value is not found in the lookup, compute a new value and update the lookup table so that all subsequent input rows with same key will use the same value from lookup table.
The steps I am doing is:
Read Input
For every input record
Lookup DB2 Table for the value
If Value is found
Write to Output
Else
Compute the random value
Write to Db2 Lookup Table
Write to Output
end If
end For
Probably in Server job we can do this using Hash files, but in Parallel job I am not able to implement this using a DB2 Stage. Please Help.