sql update command to update a date-of-birth

50 pts.
Tags:
Date format
SQL Oracle 9i
Update
I need to change the date-of-birth MONTH to May and DAYS to 15 without changing the YEAR
ASKED: September 24, 2009  2:41 PM
UPDATED: September 24, 2009  8:09 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

It has been a while since I did any Oracle but I think this will work..

UPDATE your_table
SET date-of-birth = ’15-MAY-’||EXTRACT(YEAR FROM date-of-birth)
WHERE …

and please don’t forget a WHERE clause (unless you want all birth dates set to May 15th)

meandyou

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Mji
    UPDATE your_table SET field_DOB = '27-FEB-'||EXTRACT(YEAR FROM field_DOB) where ... It's working! Thanks so much.
    50 pointsBadges:
    report
  • Meandyou
    You're very welcome. And thank you for letting me know that it worked.
    5,220 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following