Results 1 to 4 of 4
  1. #1
    Join Date
    May 2011

    Unanswered: can I UPDATE based on INSERT timestamp

    Hello Team,

    I need information on an UPDATE statement. Is there a possibility to UPDATE a set of rows based on the range of timestamp they have been INSERTed?

    For example,

    I want to UPDATE the rows which were INSERTed between
    2008-01-01- and 2008-12-31-

    Can you please assist me here.

    Thank you.

  2. #2
    Join Date
    Jan 2010

    UPDATE - IBM DB2 9.7 for Linux, UNIX, and Windows

    update <TABLE> set <COLUMN_YOU_WANT_TO_UPDATE> = NEW_VALUE where <TIMESTAMP_COLUMN> between '2008-01-01-' and '2008-12-31-'

    If you update to many rows at once, you might blow your Transactionlog.

  3. #3
    Join Date
    Sep 2004
    Quote Originally Posted by nvk@vhv View Post
    update <TABLE> set <COLUMN_YOU_WANT_TO_UPDATE> = NEW_VALUE where <TIMESTAMP_COLUMN> between '2008-01-01-' and '2008-12-31-'
    That <TIMESTAMP_COLUMN> should of course already be in that table, and it should have been declared
    If not, there is no way to ever find out when precisely a row had been inserted into the table.
    --_Peter Vanroose,
    __IBM Certified Database Administrator, DB2 9 for z/OS
    __IBM Certified Application Developer
    __ABIS Training and Consulting

  4. #4
    Join Date
    May 2011
    Hi team..
    thanks for the information..

    If <TIMESTAMP_COLUMN> this column is not defined in the concerned table, then how do a USER go with updating his table for this requirement ?

    Do anyone know, if such kind of situation exists with other users? Updating rows based on INSERT timestamps..?

    thank you

Posting Permissions

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