Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2012
    Posts
    2

    Unanswered: 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...!!

  2. #2
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    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

  3. #3
    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..?

  4. #4
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    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

  5. #5
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •