Joining A sequential file and Database table

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
raj_konig
Participant
Posts: 67
Joined: Thu Dec 22, 2005 12:27 am

Joining A sequential file and Database table

Post by raj_konig »

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
WoMaWil
Participant
Posts: 482
Joined: Thu Mar 13, 2003 7:17 am
Location: Amsterdam

Post by WoMaWil »

without any details what you finally want to join, we cannot tell you the best way, but in any case you can fill the sequential file also in a database table and than you can join as you like.
Wolfgang Hürter
Amsterdam
raj_konig
Participant
Posts: 67
Joined: Thu Dec 22, 2005 12:27 am

Post by raj_konig »

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
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

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).
raj_konig
Participant
Posts: 67
Joined: Thu Dec 22, 2005 12:27 am

Post by raj_konig »

Thanks Arnd.

But I am not trying to lookup but to join.

And even tried Merge. BU this is not accepting any inputs.

rajesh
loveojha2
Participant
Posts: 362
Joined: Thu May 26, 2005 12:59 am

Post by loveojha2 »

raj_konig wrote:Thanks Arnd.

But I am not trying to lookup but to join.

And even tried Merge. BU this is not accepting any inputs.

rajesh
But what is your Join criteria or is it like a cartesian product?
Success consists of getting up just one more time than you fall.
sudhakar_viswa
Participant
Posts: 85
Joined: Fri Nov 18, 2005 5:35 am

Post by sudhakar_viswa »

Hi,

In this scenario the table act as a look up.Drag the look up column from sequential stage to oracle stage in transformer.

bye,
sudhakar
i need to know datastage
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

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.
sekr
Participant
Posts: 14
Joined: Tue Dec 13, 2005 3:50 am

Post by sekr »

correct if im wrong !
raj wants how to load data which comming from seq file to oracle database .

seqfile------->transformer------>Oracle .
In Adv Thanks
---------s
raj_konig
Participant
Posts: 67
Joined: Thu Dec 22, 2005 12:27 am

Post by raj_konig »

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
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply