Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2006
    Location
    Pune , India
    Posts
    433

    Red face Unanswered: Another Date Prob

    I have two DB's on Two Different servers

    server1 :
    values current date
    09/03/2007

    insert into session.DateTable values DATE ('09/22/2007'); -- works fine

    server 2:
    values current date
    03/09/2007

    insert into session.DateTable values DATE ('09/22/2007'); --fails
    and i have to change it to
    insert into session.DateTable values DATE ('22/09/2007');

    why the default format are different when the DB's have same codeset and territory code ??
    ..........db2 dates always confuses me......
    Rahul Singh
    Certified DB2 9 DBA / Application Developer

  2. #2
    Join Date
    Jun 2006
    Posts
    471
    it depends on the bind of the db2cli.lst and db2ubind.lst
    the client that did the first bind defined the format
    Best Regards, Guy Przytula
    DB2 UDB LUW certified V6/7/8

  3. #3
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Best practice is to use the ISO format on an insert or update, which is always recognized by DB2 (note the dashes):

    '2007-09-22'
    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
  •