Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Temporary tables inside stored procedure

Status
Not open for further replies.

PawelTru

Programmer
Jul 18, 2002
24
0
0
US
Hello

I have few stored procedures that need to use a temporary table.
In MS-SQL that is easy by just doing
SELECT A, B INTO #tempTable1 FROM ABC

Then I have to use the temp table to get the correct data.

How do I do a similar statement in DB2.

Thanks for any help
 
PawelTru,

you can do it one of 2 ways.

You can Declare the temporary table, use it and drop it in your application. If you wish to do this you need to do something along the line of

You can have a tmeporary table defined which doesn't exist until you come to use it. It is defined up front by the Admin team. You don't have to create it, it is simply there for your use like any other table. The only difference to anormal table and this is that your program can only see it's own updates to the table, so it may effectively an instance of this table is present for each user who invokes it for the length of the currenbt UOW.

The following link explains it perfectly.


Cheers
Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top