joining tables

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
EJRoufs
Participant
Posts: 73
Joined: Tue Aug 19, 2003 2:12 pm
Location: USA

joining tables

Post by EJRoufs »

I have 5 tables that are joined on a common key. On some of the tables, there is a one-to-many relationship. What is the best way to do this in DataStage? In our last version, i believe we had a "Join" stage we could use, although i never used it. We don't have it installed yet for version 7. Would that be the best way to go about joining our multiple tables together? Or is there another, better way to do this?
Eric
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If they're all in the same database, join them with SQL; you may require outer joins depending on the exact relationships.

If they're from disjoint databases, you can use the ODBC stage's multi-row return from lookup capability.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

Where there is a one to many relationship you need to decide whether you want the many rows from the linked table or just a single row, such as the most recent, from the child table.
EJRoufs
Participant
Posts: 73
Joined: Tue Aug 19, 2003 2:12 pm
Location: USA

Post by EJRoufs »

ray.wurlod wrote:If they're all in the same database, join them with SQL; you may require outer joins depending on the exact relationships.

If they're from disjoint databases, you can use the ODBC stage's multi-row return from lookup capability.

Join them with SQL.... using the "Join" stage in DataStage?
Eric
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Yes - Join stage, OCI stage, whatever. By the way, the Join stage is only in the PX/EE product - not the Server edition.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply