If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > buffering the changes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-04-12, 22:56
ANU MUKERJI ANU MUKERJI is offline
Registered User
 
Join Date: Feb 2012
Posts: 2
buffering the changes

Hi,

I am using eclipse as client to connect to db2 through an ip, and I easily get connected but for my research I need to fire an update statement in database in some tables but since other users are also sharing that database as I am doing so changes in table bring effect to them also , how can I ensure that whatever changes I do will not effect to them,and whenever I close my session the original values will remain in that table itself...!!
Reply With Quote
  #2 (permalink)  
Old 02-05-12, 14:57
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
Don't update the tables and use others instead. I.e. you could copy the table data into a temp table, make your changes on the copy and the temp table will be gone at the end of your session.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #3 (permalink)  
Old 02-07-12, 09:33
ANU MUKERJI ANU MUKERJI is offline
Registered User
 
Join Date: Feb 2012
Posts: 2
copying a table into temp

Hi Folks,

Thanks for the info, is temp table is already provided by db2,,,and could you please show the sample statement of copying ,,if assume we have a table name Employee, then how to copy this into temp..?
Reply With Quote
  #4 (permalink)  
Old 02-07-12, 12:30
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
Have a look at the DECLARE TEMPORARY TABLE and CREATE GLOBAL TEMPORARY TABLE statements in the manual. A temp table is a regular table created/declared by those statements. That means, it has columns and rows and you use INSERT/DELETE/UPDATE/MERGE on them. Nothing special about this.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #5 (permalink)  
Old 02-07-12, 19:26
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
As Stolze says, lookup for "Global Temporary Tables" (GTT) in db2 documentation.

The global temp tables can be either Created/Declared [ the types of GTT ]

HTH

Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On