Hash file look up
Posted: Tue Dec 14, 2010 4:41 pm
HI All,
Scenario: Source is a txt file, and needs to load the data into Db2 database. If the same row exists in database, increment the sequence number and insert the row, if not sequence number will be defaulted to 1.
Eg: AAA,BBB,CCC,DDD (will be having seq number 1 while db insert)
AAA,BBB,CCC,EEE (Will be having Seq number 1 while inserting)
AAA,BBB,CCC,FFF( lets say this record already inthe Db, so my seq number should be 2 here)
To make my 3rd record insert above success, i had to query the table before data load and in the transformer stage of the dat load i am looking it up with key. For sure i have keys loaded into Hashed file, but when i am looking it for key presence i am getting nothing all the time.I am inserting the same rows again and again for testing purpose.(of course it fails with duplicate key error)
FYI:
4th column is date column and if i look at the hashfile, the date is stored as a number so when i am comparing the date fields i am using Iconv(LocalDptrDate , "D-E") in input and Iconv(LocalDptrDate,"D-E") in key.
Any help would be great.
Scenario: Source is a txt file, and needs to load the data into Db2 database. If the same row exists in database, increment the sequence number and insert the row, if not sequence number will be defaulted to 1.
Eg: AAA,BBB,CCC,DDD (will be having seq number 1 while db insert)
AAA,BBB,CCC,EEE (Will be having Seq number 1 while inserting)
AAA,BBB,CCC,FFF( lets say this record already inthe Db, so my seq number should be 2 here)
To make my 3rd record insert above success, i had to query the table before data load and in the transformer stage of the dat load i am looking it up with key. For sure i have keys loaded into Hashed file, but when i am looking it for key presence i am getting nothing all the time.I am inserting the same rows again and again for testing purpose.(of course it fails with duplicate key error)
FYI:
4th column is date column and if i look at the hashfile, the date is stored as a number so when i am comparing the date fields i am using Iconv(LocalDptrDate , "D-E") in input and Iconv(LocalDptrDate,"D-E") in key.
Any help would be great.