Key column in Hashed File
Moderators: chulett, rschirm, roy
Key column in Hashed File
Hi,
I am loading the data from db2 to Hashed file. I have a key column in Hashed file. suppose if the key column is having 5 same values which value out of 5 will store in the hashed file either first or second.....fifth?
thanks in advance.
I am loading the data from db2 to Hashed file. I have a key column in Hashed file. suppose if the key column is having 5 same values which value out of 5 will store in the hashed file either first or second.....fifth?
thanks in advance.
Ravi
Key column in Hashed File
thanks Balaji,
But if i want to take the first record what should I do?
thanks in advance.
But if i want to take the first record what should I do?
thanks in advance.
Ravi
Key column in Hashed File
Hi Balaji,
I will give a simple scenario here. I am loading two columns into Hashed file from DB2. one is Key col. suppose the data is like
key col1 col2
10 x
10 y
10 z
when I load the data into hashed file i will get only the last record i.e 10, z but i want the value x to be loaded into my hashed file. What is the procedure to do it?
any answer can be appreciated.
I will give a simple scenario here. I am loading two columns into Hashed file from DB2. one is Key col. suppose the data is like
key col1 col2
10 x
10 y
10 z
when I load the data into hashed file i will get only the last record i.e 10, z but i want the value x to be loaded into my hashed file. What is the procedure to do it?
any answer can be appreciated.
Ravi
-
- Charter Member
- Posts: 166
- Joined: Wed Mar 16, 2005 6:52 am
- Location: Mumbai, India
Before loading to the Hashed file, SOrt and use a transformer to select and pass out the first row for a given key value.
Amey Vaidya<i>
I am rarely happier than when spending an entire day programming my computer to perform automatically a task that it would otherwise take me a good ten seconds to do by hand.</i>
<i>- Douglas Adams</i>
I am rarely happier than when spending an entire day programming my computer to perform automatically a task that it would otherwise take me a good ten seconds to do by hand.</i>
<i>- Douglas Adams</i>
-
- Premium Member
- Posts: 30
- Joined: Thu Jan 16, 2003 2:51 pm
You can create a job like:
In the Transformer, the Constraint for Hash File A would be
If IsNull(Hash File A Lkup.field) Then @TRUE Else @FALSE
So if the row does not exist in the Hash file, write it, otherwise do not write the row. This way only the first row ends up being loaded.
Code: Select all
Hash File A Lkup
|
V
DB2 ---------> Transformer ---------> Hash File A
If IsNull(Hash File A Lkup.field) Then @TRUE Else @FALSE
So if the row does not exist in the Hash file, write it, otherwise do not write the row. This way only the first row ends up being loaded.