OLEDB stage

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
justlrng
Participant
Posts: 30
Joined: Thu Oct 16, 2003 1:17 pm

OLEDB stage

Post by justlrng »

Hi,

I am wondering if it is possible to use an OLEDB stage (connecting to SQL server) to create temp. tables on the fly and then read in the results of the temp. table to DataStage for further processing.

Thanks.
rasi
Participant
Posts: 464
Joined: Fri Oct 25, 2002 1:33 am
Location: Australia, Sydney

Post by rasi »

Read the documention for Temp tables in SQL Server.

You can create temp tables using datastage. But when the session is closed the temp table is also removed from the database. As long you can do it in one single session yes you can use it.

Thanks
Siva
justlrng
Participant
Posts: 30
Joined: Thu Oct 16, 2003 1:17 pm

Post by justlrng »

I have tried creating a temp table and then reading the results back in another query all within the same stage, however, I get a "Link initialization failure" every time. Therefore I wasn't sure that temp tables were possible within DataStage but if it is possible I will have to keep trying. Thank you Siva.
shawn_ramsey
Participant
Posts: 145
Joined: Fri May 02, 2003 9:59 am
Location: Seattle, Washington. USA

Post by shawn_ramsey »

justlrng wrote:I have tried creating a temp table and then reading the results back in another query all within the same stage, however, I get a "Link initialization failure" every time. Therefore I wasn't sure that temp tables were possible within DataStage but if it is possible I will have to keep trying. Thank you Siva.
I have done this before where the temp table is created and populated in the before SQL then read in the same stage's user defined SQL. I think that this is about the only way you could use the temp table since (from what I can tell) each OLEDB stage in the job has it own OLEDB session.
Shawn Ramsey

"It is a mistake to think you can solve any major problems just with potatoes."
-- Douglas Adams
justlrng
Participant
Posts: 30
Joined: Thu Oct 16, 2003 1:17 pm

Post by justlrng »

shawn_ramsey wrote: I have done this before where the temp table is created and populated in the before SQL then read in the same stage's user defined SQL. I think that this is about the only way you could use the temp table since (from what I can tell) each OLEDB stage in the job has it own OLEDB session.
I never thought about using the Before SQL - I'll try that. Thanks. :)
Post Reply