Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DB2 UDB UPDATE

Status
Not open for further replies.

DB2Problem

Programmer
Oct 17, 2002
53
US
Hi ,

I am trying to update a date field using following command

update <schema_name>.<table_name> set <column_name_1> = '07/08/2003' where <coulm_name_2> = 9999

The above query updates the record for 9999 to 07/08/2003.

But i think i am specifying incorrect format for the date field (Because i do not see any results from the sql written in a java program).

I have used the above format because when i loaded the data in the table i used mm/dd/yyyy format for date field.

I need your feedback in understanding what format should i use when updating date fields in DB2 UDB..

Thanks

 
Hi,
There are numerous different formats of the db2 date and it depends on which standard your site has accepted as default. They differ in their placement of DD, MM and CCYY and also in their separator (- , /). If you do not know anybody at your site who can help you, try a number of different formats to see which is applicable, although I have always had most success with CCYY-MM-DD.

From your post, it appears that the update works as you have not stated that you are recieving errors from the update, just a lack of rows from the select. I would try alternative date formats in the select.
Marc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top