If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Another Date Prob

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-03-07, 09:59
rahul_s80 rahul_s80 is offline
Registered User
 
Join Date: Jul 2006
Location: Pune , India
Posts: 433
Red face 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
Reply With Quote
  #2 (permalink)  
Old 09-03-07, 10:34
guyprzytula guyprzytula is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 09-03-07, 11:56
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On