Convert VARCHAR to Date

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
amitendra_amit
Participant
Posts: 27
Joined: Fri Jul 28, 2006 2:11 pm

Convert VARCHAR to Date

Post by amitendra_amit »

Hai,

I'm trying to convert VARCHAR(40) data from an Oracle DB source on windows to date data format for an oracle output table.
My Source Column is (Start Date -(mm/dd/yyyy) )
Datatype : Varchar
Target Datatype is (Agg_Start Date) -(dd-mon-yyyy))
Datatype: Date.

I have tried this format : OConv(IConv(Dslink.Start_Date, "D"),"D-YMD[4,2,2]"):" 00:00:00"

And also I have tried this query also

Oconv(Iconv(Dslink.Start_Date, "D MDY[A,2,4]"),"D-YMD[4,2,2]")

When i run the job, i got this warning.

stgSURVEY_EXTERNAL_JOURNAL_REVENUE..Transformer: At row 1, link "LNK_ _PERIPHERAL_SURVEY", while processing column "START_DT"
Value treated as NULL
Attempt to convert String value "2006-12-31" to Date type unsuccessful.

What function/transform should I use?

Regards,

amit
Sunshine
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

This question looks suspiciously like this recent thread - are you on the same project?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
amitendra_amit
Participant
Posts: 27
Joined: Fri Jul 28, 2006 2:11 pm

Post by amitendra_amit »

Yes
Sunshine
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:roll: Then why the heck not respond over there? Why start up the merry-go-round all over again?

Are you doing what was suggested there? The answer must be 'no' or it would be working. I'll wager you are using user-defined sql, yes?
-craig

"You can never have too many knives" -- Logan Nine Fingers
samythiru
Participant
Posts: 13
Joined: Tue Feb 28, 2006 3:55 pm

Post by samythiru »

Hi ,

Try writting server routine. May be it will help you.
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

This topic has already been resolved in the other POST.
Post Reply