sql update command to update a date-of-birth
50 pts.
0
Q:
sql update command to update a date-of-birth
I need to change the date-of-birth MONTH to May and DAYS to 15 without changing the YEAR
ASKED: Sep 24 2009  2:41 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
1840 pts.
0
A:
 RATE THIS ANSWER
+1
Click to Vote:
  •   1
  •  0
  • AddThis Social Bookmark Button
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
Last Answered: Sep 24 2009  3:43 PM GMT by Meandyou   1840 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Mji   50 pts.  |   Sep 24 2009  3:54PM GMT

UPDATE your_table
SET field_DOB = ‘27-FEB-’||EXTRACT(YEAR FROM field_DOB)
where …

It’s working! Thanks so much.

 

Meandyou   1840 pts.  |   Sep 24 2009  8:09PM GMT

You’re very welcome.

And thank you for letting me know that it worked.

 
0