Can I use a SQL Server #Temp table in another transformation

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
sbass1
Premium Member
Premium Member
Posts: 211
Joined: Wed Jan 28, 2009 9:00 pm
Location: Sydney, Australia

Can I use a SQL Server #Temp table in another transformation

Post by sbass1 »

Job Design:

Seq File --> xfm1 --> SQL Server #Temp table --> select distinct --> xmf2 --> SQL Server final table

I need to do a bunch of lookups in xfm1, where the lookups will map source data to different values (example effective date to month surrogate key). I then need to write the distinct rows to the final table.

A great case for a transient, temporary SQL Server table. Alas, since DS does not persist the connection to SQL Server, the temp table is gone when xfm2 kicks in.

Is there any way to get DS to not drop the initial SQL Server connection so I can use temporary tables?

Thanks,
Scott
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You can more easily use UniVerse table in this scenario.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sbass1
Premium Member
Premium Member
Posts: 211
Joined: Wed Jan 28, 2009 9:00 pm
Location: Sydney, Australia

Post by sbass1 »

Can I do select distinct <composite key> on the Universe table?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Yes.

In fact, if you want the entire composite key, it's easier and faster. The system variable @ID accesses the entire composite key. However, this is necessarily unique anyway - it's the primary key.
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