CONVERT DD-MON-YY to YYYY-MM-DD

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
praburaj
Premium Member
Premium Member
Posts: 133
Joined: Thu Jun 30, 2005 1:26 am
Location: philippines

CONVERT DD-MON-YY to YYYY-MM-DD

Post by praburaj »

I have csv source file from that i am getting the date column in the format "dd-mon-yy" but, i need to load into oracle table with the format yyyy-mm-dd. Plz help me how to achieve this.
prabakaran.v
Ravi.K
Participant
Posts: 209
Joined: Sat Nov 20, 2010 11:33 pm
Location: Bangalore

Post by Ravi.K »

Year part is partially avilable. So, whether it could be 20th or 21st Century. So, the below derivation helps for 21st century only. If you have any limitations change accordingly.

DateToString(StringToDate('06-Feb-11','%dd-%mmm-%2000yy'),'%yyyy-%mm-%dd')
Cheers
Ravi K
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

By any chance is your Oracle target column a DATE? If so then you don't need to convert it to any particular format, just convert it to a Date.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply