@INROWNUM NOT UNIQUE!!
Posted: Mon Jan 10, 2005 4:41 pm
DSXers,
I am loading a table with a unique (surrogate) key.
We have a hash file that maintains the the MAX() surrogate key for each table.
For all new records, the key values are generated in a link variable which uses the MAX() surrogate key from the hash and @INROWNUM:
SurrogateKey = HashMaxKeyLookup.MAX_SURRKEY + @INROWNUM
The issue is this expression is generating duplicates. The hash file has a single record (with value of 36,809). But I'm getting 55,115 as the SurrogateKey on two output records, which indicates that this happens on input row number 18,306 (55,115 - 36,809).
One thing I have noticed is that @OUTROWNUM is not repeating and creates unique keys. BUT, @OUTROWNUM is not available in Stage Variables.
Any ideas?
This is completely reproducible.
I am loading a table with a unique (surrogate) key.
We have a hash file that maintains the the MAX() surrogate key for each table.
For all new records, the key values are generated in a link variable which uses the MAX() surrogate key from the hash and @INROWNUM:
SurrogateKey = HashMaxKeyLookup.MAX_SURRKEY + @INROWNUM
The issue is this expression is generating duplicates. The hash file has a single record (with value of 36,809). But I'm getting 55,115 as the SurrogateKey on two output records, which indicates that this happens on input row number 18,306 (55,115 - 36,809).
One thing I have noticed is that @OUTROWNUM is not repeating and creates unique keys. BUT, @OUTROWNUM is not available in Stage Variables.
Any ideas?
This is completely reproducible.