Conversion error - TimeStamp_From_String

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
cherry
Participant
Posts: 108
Joined: Sun Jul 10, 2005 1:35 am

Conversion error - TimeStamp_From_String

Post by cherry »

Hi All,

I have a date field from the input and it's value is 1997-10-20 16:36:51 and type is Varchar(19).

Iam trying to load it to a db2 table and the SQL type is TimeStamp(19).

I have done the following conversion:

StringToTimestamp(<Field_Nmae>,"%yyyy-%mm-%dd %hh:%nn:%ss")

Iam getting the following error message.

APT_CombinedOperatorController,6: Conversion error calling conversion routine timestamp_from_string data may have been lost

Please advise.

Regards
Cherry
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Just to see what might be happening, add another transform stage where you convert your timestamp back to a string and see what the value might be. Also, disable operator combination and see which stage is giving you the warning message.
srinivas.g
Participant
Posts: 251
Joined: Mon Jun 09, 2008 5:52 am

Post by srinivas.g »

Just use below one :

StringToTimestamp(<Field_Nmae>,"%yyyy-%mm-%dd %hh:%mi:%ss")
Srinu Gadipudi
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

srinivas - the %mi" works in Oracle, but is the wrong format picture for DataStage.
abhijain
Participant
Posts: 88
Joined: Wed Jun 13, 2007 1:10 pm
Location: India

Post by abhijain »

Use

StringToTimestamp((<Field_Nmae>,"%yyyy-%mm-%dd %hh:%nn:%ss")

%nn is the correct one for month.
Rgrds,
Abhi
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

abhi - what is different between your suggestion and the original post? I can't see a difference.
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

There is a difference Arnd. You just haven't noticed it. There is an extra "(" in the later post which makes it incorrect. :wink:

It can happen in a lot of cases where
format picture is inconsistant
column length
unwanted characters (extra spaces, but if you are sure its varchar(19) through out check for different formats you are getting)
Unicode to ascii conversion(generally has other warning message too)?

Do as Arnd suggested and let us know the results.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
Post Reply