Updating Date.. [message #81446] |
Tue, 18 February 2003 23:58 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Muzzammil
Messages: 99 Registered: February 2003
|
Member |
|
|
Hi experts,
I have table which contains idate field in date format.
I want to update only mon-rrrr without DD what should I do. It should be in date format only not numeric or char format.
Kindly help.
Regards,
Syed Muzzammil.
|
|
|
|
Re: Updating Date.. [message #81451 is a reply to message #81446] |
Wed, 19 February 2003 03:12 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
magnetic
Messages: 324 Registered: January 2003
|
Senior Member |
|
|
suppose you want to update idate=19-FEB-2003
var1 varchar2(9):= to_char(idate,'DDMONRRRR')
var2 varchar2(9):= DD||'MAR2003';
where DD is the same DD and MAR2003 is the new value.
update table x
set idate=to_date(var2);
commit;
the clue is working with variabeles and converting date formats to varchar2 and reverse conversion to date again.
|
|
|