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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I Create an Updateable Global Temp Table?

Status
Not open for further replies.

jlockwo

ISP
Aug 19, 2003
2
US
We have several updateable global temp tables in our system, but do not know how they were originally created. Does anyone know how to create these global temp tables? They are not Declared Temp tables, since they appear in our Sysibm.systables with a type of 'G'. This is quite urgent. Any help would be greatly appreciated!!!! We have DB2 V7.
 
Well, since these tables appear in sysibm.systables, I am assuming that they are CREATED temporary tables, not DECLARED ones. Am I understanding this wrong? I thought declared temp tables don't exist outside of the program they are in and therefore do not appear in Sysibm.systables.
 
I guess your global temp tables was created with a

CREATE GLOBAL TEMPORARY TABLE statement

You can read much more about created temporary tables in "DB2 SQL Reference"

Helle Stålander
 
jlockwo,

this is a way of creating temporary tables upfront which your programmers don't have to declare each time they use them. They are simply there to be used by the application program like any other table, saving them having to be declared each time they are used.

The only difference between these and an ordinary table are only your UOW can see the data you insert to these tables and the entires you place on there effectively disappear at either commit or rollback.

I agree with Staland as to how they have been created.

Cheers
Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top