Learner
Learner

Reputation: 1

Datastage: String to Timestamp to milli seconds conversion

I'm trying to insert timestamp with milli seconds into a database. I tried following steps but haven't had any luck.

Design :

Sequential file --> TX --> destination (SQL/Seq file)

Could you please assist a solution for this?

Upvotes: 0

Views: 9468

Answers (3)

SreedeepS
SreedeepS

Reputation: 1

Most important thing is to override the default NLS settings in the job with expected format (%yyyy-%mm-%dd %hh:%nn:%ss.3) which you have already completed.

Now, for the microseconds part which is not being displayed, you can enable the Microseconds extended attribute for the field in the target stage used.

Also you can refer this link from IBM which explains a similar scenario

Upvotes: 0

Sukriti Singh
Sukriti Singh

Reputation: 53

try below command in transformer stage and set the target data type as per the requirement, it will give the required result:

StringToTimestamp(Columnname,"%yyyy-%mm-%dd %hh:%nn:%ss.3")

Upvotes: 1

MichaelTiefenbacher
MichaelTiefenbacher

Reputation: 4005

What you tried looks good so far with one exception:

length 26 and scale 3

Using Db2 for example you would need to specify length 26 precision 6. 26 and 3 do not fit as

%yyyy-%mm-%dd %hh:%nn:%ss has length of 20

Specifying microsenonds is extended attriute is also necessary.

Have a try and provide more details of the target system if you still have problems

Upvotes: 0

Related Questions