Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2009

    Unanswered: how to set the current date as the default date as the value of a field

    I need to have the value of the column as the current date what is the query to set the value as the current date.

  2. #2
    Join Date
    Apr 2006
    Provided Answers: 11
    select current date from sysibm.sysdummy1
    is that what you mean or pleae, be more specific
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified

  3. #3
    Join Date
    May 2003
    update emp set birthdate = current_date;


    update emp set birthdate = current_date where birthdate is null;

    Note sure which of the above you want.

    I you want the current date to be the default going forward for newly inserted rows, you can alter the table to set the default value for the column to current_date.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

Posting Permissions

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