Results 1 to 3 of 3
  1. #1
    Join Date
    May 2007
    Location
    somewhere in dbforums
    Posts
    221

    Unanswered: system create/update date

    i have a table which has system create date and system update date......
    so my table definition is

    create table Mytable
    (
    id integer not null,
    content char(100),
    create_date date ,
    update_date date
    )

    is it possible that whenever i create an id the create date and update date get sets automatically to current date and when i update the same id contents only the update date gets updated to current date.....

    i know this can be done using trigggers.....but is it possible that this can be done using the create table definition only...

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    No, because updates only take place on the columns you specify. I don't what the problem is in creating a trigger.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  3. #3
    Join Date
    May 2007
    Location
    somewhere in dbforums
    Posts
    221
    well i have around 20 tables requiring the same criteria so i was curious to check whether this could be done without triggers since then I'll have to create 20 triggers for each of the tables in the database.....

Posting Permissions

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