string to timestamp

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
pavankatra
Participant
Posts: 86
Joined: Wed Mar 03, 2010 3:09 am

string to timestamp

Post by pavankatra »

hi,
my input column:doc_guid
datatype :varchar
I want to insert this value into target
StringToTimestamp(lk_read.sheet,"yyyy-mm-dd hh:nn:ss")

i want to implement this in transformer.

I am getting below error
APT_CombinedOperatorController,0: Caught exception from runLocally(): APT_ParseError: Parsing parameters "yyyy-%mm-%dd hh:nn:ss" for conversion "timestamp=timestamp_from_ustring[%yyyy-%mm-%dd %hh:%nn:%ss](ustring)": APT_Conversion_String_TimeStamp: Invalid format [yyyy-%mm-%dd hh:nn:ss] used for string_from_time type conversion.
So can anyone please help me on this

Thanks in advace
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

The format must be

Code: Select all

%yyyy-%mm-%dd %hh:%nn:%ss
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

The format must be

Code: Select all

%yyyy-%mm-%dd %hh:%nn:%ss
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

The format must be

Code: Select all

%yyyy-%mm-%dd %hh:%nn:%ss
Etler21
Participant
Posts: 52
Joined: Mon Mar 08, 2010 5:51 am

Post by Etler21 »

try this way -

StringToTimestamp((lk_read.sheet[1,4]:'-':lk_read.sheet[5,2]:'-':lk_read.sheet[7,2]) : "-" : "00" :"." : "00" :"." : "00" )
pavankatra
Participant
Posts: 86
Joined: Wed Mar 03, 2010 3:09 am

Post by pavankatra »

Sainath.Srinivasan wrote:The format must be

Code: Select all

%yyyy-%mm-%dd %hh:%nn:%ss
thanks for your reply
i have given like this
StringToTimestamp(lk_read.sheet,"yyyy-mm-dd hh:nn:ss")
i was tried with this %yyyy-%mm-%dd %hh:%nn:%ss,but its not accepting.so please sugget me how to do this

thanks in advance for your help.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

What do you mean by 'not accepting' ?

Post the exact derivation and the corresponding warning / error.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Also let us know what the "target" is.
-craig

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