Joining A sequential file and Database table
Moderators: chulett, rschirm, roy
Joining A sequential file and Database table
Folks,
Could you please let me know how can i join Sequential file and a Database table?
I tried using SQL Builder but couldnt get tht.
Thanks in advance
rajesh
Could you please let me know how can i join Sequential file and a Database table?
I tried using SQL Builder but couldnt get tht.
Thanks in advance
rajesh
I am usign sequential file as source and after the transformation stage i am trying to join the transformed data coming from transformer and database table then insert into the target
My intension is not to loopkup but to join the database table and the transformed data from sequential file .
thanks
rajesh
My intension is not to loopkup but to join the database table and the transformed data from sequential file .
thanks
rajesh
Rajesh,
take a look at the documentation on the "merge" stage in DataStage Server edition, you will find that this addresses your question, at least partially. You might also think about loading the table to a hashed file and doing a lookup on that (you can load it to memory if it fits to further increase speed).
take a look at the documentation on the "merge" stage in DataStage Server edition, you will find that this addresses your question, at least partially. You might also think about loading the table to a hashed file and doing a lookup on that (you can load it to memory if it fits to further increase speed).
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 85
- Joined: Fri Nov 18, 2005 5:35 am
Raj, PLEASE read the documentation on the merge stage; it does not accept input links but uses input sequential files to do the type of join you want; so you would need to get an extract from the database table into a flat file to make that work. The hashed file lookup suggestion might perform better than your other options, which is why I mentioned it. Your requirement to not use a lookup is probably based on preconceptions about performance that might not be correct.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
thank you for all the replies.
Yes, my intenstion is a cartesian product.
I cannt use merge Arnd. Because I am trying to join these 2 in the mid of the mapping but not at the beggining.
Hope u guys understand the situation.
If the final soultion for this is merge only then I have no other go than to split the mapping into 2.
rajesh
Yes, my intenstion is a cartesian product.
I cannt use merge Arnd. Because I am trying to join these 2 in the mid of the mapping but not at the beggining.
Hope u guys understand the situation.
If the final soultion for this is merge only then I have no other go than to split the mapping into 2.
rajesh
Raj,
<sigh> you can use the merge stage, it is up to your job design on what is considered to be the "middle of mapping". If you write to two sequential files (which can also be named pipes to save on disk I/O) you can then read from those using a merge stage in the same job; this is an accepted and frequently used method of controlling your job flow.
You really should try loading your table selection to a hashed file that is used as a reference lookup; this might give you better performance than other solutions.
<sigh> you can use the merge stage, it is up to your job design on what is considered to be the "middle of mapping". If you write to two sequential files (which can also be named pipes to save on disk I/O) you can then read from those using a merge stage in the same job; this is an accepted and frequently used method of controlling your job flow.
You really should try loading your table selection to a hashed file that is used as a reference lookup; this might give you better performance than other solutions.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
A lookup IS a join.
A lookup is a left outer join, in that it returns NULL if the lookup does not succeed.
You can convert this to an inner join by constraining the Transformer output to only those rows for which the lookup succeeded.
However it is not possible to achieve a full outer join (or a Cartesian product) using a Transformer stage lookup.
A Merge stage can do a full outer join. It requires two sequential files as its inputs. Arnd's suggestion of using pipes could be useful, but using actual seqential files may not be all that slower, depending on data volume.
A lookup is a left outer join, in that it returns NULL if the lookup does not succeed.
You can convert this to an inner join by constraining the Transformer output to only those rows for which the lookup succeeded.
However it is not possible to achieve a full outer join (or a Cartesian product) using a Transformer stage lookup.
A Merge stage can do a full outer join. It requires two sequential files as its inputs. Arnd's suggestion of using pipes could be useful, but using actual seqential files may not be all that slower, depending on data volume.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.