DB2 - JOINing a TEMPORARY 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
DStageNewbie
Participant
Posts: 11
Joined: Wed Aug 12, 2009 6:05 am
Location: Kansas City

DB2 - JOINing a TEMPORARY table

Post by DStageNewbie »

I want to build a temp table and then use that temp table to JOIN with another DB2 table. Can this be done? I have seen other posts where its mentioned that it can be done in a UNIX script. This would not help me, since I don't know UNIX. I have built the temp table, but I think it is going away before I can JOIN it. From my db2 stage that creates the temp table, would I draw my link to a db2 stage having the table I want to JOIN to?
Bob
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No, because by then your temp table would be gone. You would need to create and popuplate it 'before sql' and then join to it right then. Does this really need to be a true temp table? Perhaps you could persist the table and then drop it after job if all goes well.
-craig

"You can never have too many knives" -- Logan Nine Fingers
DStageNewbie
Participant
Posts: 11
Joined: Wed Aug 12, 2009 6:05 am
Location: Kansas City

Post by DStageNewbie »

the data used to populate the temp table is on another platform/server so building the temp table in the BEFORE tab would not work, right?
Bob
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Probably wrong. At least not for that reason. The before SQL is executed on the same connection as the main part of the stage.
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