Page 1 of 1

type conversion

Posted: Thu Mar 08, 2007 4:06 pm
by laxmi_etl
Hi-

I have one funny thing going on with my job.

One of the fields in my job needs string to timestamp conversion for that
I used the fallowing function.

StringToTimestamp((DSLink5.SrcFileDt): "00:00:00","%yyyy-%mm-%dd %hh:%nn:%ss")
This is working good.

But when I use the same function in another job
for the same field it's giving output **********

Anybody can tell what might be the reason.

Thanks.

Re: type conversion

Posted: Thu Mar 08, 2007 4:51 pm
by Yuan_Edward
That means StringToTimestamp fails. Check the format of the input value where you got the output **********.
laxmi_etl wrote:Hi-

I have one funny thing going on with my job.

One of the fields in my job needs string to timestamp conversion for that
I used the fallowing function.

StringToTimestamp((DSLink5.SrcFileDt): "00:00:00","%yyyy-%mm-%dd %hh:%nn:%ss")
This is working good.

But when I use the same function in another job
for the same field it's giving output **********

Anybody can tell what might be the reason.

Thanks.

Posted: Thu Mar 08, 2007 5:25 pm
by mansoor_nb
You will get these kind of results if your source string field is converted properly into the timestamp format before conversion or there migght be nulls in your source string column.

If there are nulls then check for nulls and then convert it into timestamp.

Posted: Thu Mar 08, 2007 5:34 pm
by laxmi_etl
mansoor_nb wrote:You will get these kind of results if your source string field is converted properly into the timestamp format before conversion or there migght be nulls in your source string column.

If there are nulls then check for nulls and then convert it into timestamp.
Ok, source field data is in 20050503 (sting) format I want to conver it to timestamp.
Bisically I am getting ****** type of data in the output file for each and every record.

There are no nulls as you said.

Posted: Thu Mar 08, 2007 5:34 pm
by laxmi_etl
Ok, source field data is in 20050503 (sting) format I want to convert it to timestamp.
Bisically I am getting ****** type of data in the output file for each and every record.

There are no nulls as you said.[/quote]

Re: type conversion

Posted: Thu Mar 08, 2007 5:48 pm
by us1aslam1us
laxmi_etl wrote: But when I use the same function in another job
for the same field it's giving output **********
Thanks.
The only difference in you previous post's code and new one is Trim function. Try using trim here. Also check the length of the field in the target.

Posted: Thu Mar 08, 2007 5:54 pm
by kumar_s
Its not only trim, but the pattern that you use to convert.
"%yyyy-%mm-%dd %hh:%nn:%ss" is what you had given, but actual current pattern is

Code: Select all

"%yyyy%mm%dd %hh:%nn:%ss"
no '-'s delimited.

Posted: Thu Mar 08, 2007 5:55 pm
by us1aslam1us
Sorry Laxmi. I haven't seen that part closely kumar.Thanks

Posted: Thu Mar 08, 2007 6:34 pm
by ray.wurlod
Is the receiving field big enough to receive the data?