Problem in converting String To TIME with micro seconds

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
jpraveen
Participant
Posts: 71
Joined: Sat Jun 06, 2009 7:10 am
Location: HYD

Problem in converting String To TIME with micro seconds

Post by jpraveen »

Hi

I have a problem while i convert to string to Time.

my source is Flat file(fixed width) and need to load data into table(teradata)

The data for Time column from File is like

10:21:15
09:06:58
12:45:06

etc.,
I am generating some random numbers like 000001,123466,001523, etc.,

Now i need to append some random 6 digit numbers as micro seconds and try to load data into table ( column metadata as TIME(6) )

So , i have concatenated as 10:21:15 123456

But while the data is loaded the result in table as showing 10:21:15.000000

Is there any function like stringtotime(incol1,"%hh %mm %ss.s6") or esle anything..stringtotime(incol1,"%hh %mm %ss.s(6)")

I am sure there is no function like above

is i am missing the basics ?

Kindly suggest ..

Thank you
Jaypee
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Shouldn't you be using a "dot" between them rather than a space? Also ensure you have enabled Microseconds in the extended properties for that column.
-craig

"You can never have too many knives" -- Logan Nine Fingers
jpraveen
Participant
Posts: 71
Joined: Sat Jun 06, 2009 7:10 am
Location: HYD

Post by jpraveen »

Yes added 'dot' and Time(15,6)

Still the data is like '10:26:38.000000' in Table

Convserion :- StringToTime(InputCol,"%hh:%nn:%ss")

My input is '10:26:38.123456', but how to get micro seconds ?
Jaypee
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Since you didn't mention it, what about the extended properties - was that something you were able to set?

Also note that, once that is set, your conversion should be StringToTime(InputCol,"%hh:%nn:%ss.6")
-craig

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