Hi everyone,
If I write data to a has file that already has data, is it going to delete existing data on the has file? or the new data will do an update or insert to the hash file, that is, if the key of the new data correspond to an entry on the hash file, then update, else insert the new data.
Your answers will be greated appreciated.
writing to a hash file that already has data
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 483
- Joined: Thu Jun 12, 2003 4:47 pm
- Location: St. Louis, Missouri USA
DataStage will not clear the hash file unless you have 'Clear before writing' checked (on the input tab of the hash file stage) or " 'Create File checked' and 'Delete file before create' checked in the Options dialog (click the Options button) "
If you write data to a hash file that has existing data, it will overwrite any records it finds with existing keys with the new data coming in. In effect "last record in wins". If the key doesn't exist, it will insert it into the hash file.
I hope this helps,
Tony
If you write data to a hash file that has existing data, it will overwrite any records it finds with existing keys with the new data coming in. In effect "last record in wins". If the key doesn't exist, it will insert it into the hash file.
I hope this helps,
Tony
If you do not tell the stage to clear or create the file then existing data are preserved unless you are writing a row that already exists. All writes to a Hash are destructive meaning that if the record exists it will be replaced with the new row.
There are techniques (and have been explained via this forum) on how to essentially update hash files so try a search and see what you can find.
Regards,
There are techniques (and have been explained via this forum) on how to essentially update hash files so try a search and see what you can find.
Regards,
Mike Hester
mhester@petra-ps.com
mhester@petra-ps.com