Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2009
    Posts
    153

    Unanswered: Automatic date time updation

    HI Experts,

    I want to have a column which can track the changes in a particular row..How can i achieve the same ?which datatype to use?


    TIA

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    what db2 version and platform are you on ?
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  3. #3
    Join Date
    Jan 2009
    Posts
    153
    DB2 9.5c Express

    Windows XP Professional

  4. #4
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    Code:
    CREATE TABLE TABLENAME1 (
    COL1 INT, 
    COL2 INT, 
    LAST_UPDATE_TS TIMESTAMP NOT NULL GENERATED ALWAYS FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP
    )
    does this help?
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  5. #5
    Join Date
    Jan 2009
    Posts
    153
    Thanks Satya it worked...:-)

  6. #6
    Join Date
    Jan 2009
    Posts
    153
    By the way is there any constraint to achieve the same?

    How can i alter a column to include this change?

  7. #7
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    ALTER TABLE Statement ?

    IIRC, you have to issue a SET INTEGRITY Statement following this alter
    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
  •