Initialization of timestamp to zero in Px transformer

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
venkatvelpula
Participant
Posts: 80
Joined: Sat Mar 18, 2006 10:27 pm

Initialization of timestamp to zero in Px transformer

Post by venkatvelpula »

I am adding this timestamp filed to output link of transformer. datatype timestamp 38. In the transformer, if I give default value 0 in the derivation, its giving an error saying that, invalid conversion from int8 to timestamp.

Can anybody help me?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

You cannot assign a value of 0 to a timestamp. Try StringToTimeStamp('1900-01-01 00:00:00','%yyyy-%mm%-dd %hh:%nn:%ss').
venkatvelpula
Participant
Posts: 80
Joined: Sat Mar 18, 2006 10:27 pm

Post by venkatvelpula »

I added column "PROCESSTIMESTAMP_MOD" data type char(10) in the output of the transformer, after that in the modify stage ( Processtimestamp_mod as input (char(10)) and processtimestamp as output, data type "TimeStamp (38) applied stringtoTimestamp function, but i got the following error.

main_program: Error parsing modify adapter: Error in binding: Unknown conversion: StringToTimeStamp
Expected destination field selector, got: ")"; input:
PROCESSTIMESTAMP : TIMESTAMP = StringToTimeStamp(1900-01-01 00:00:00,%yyyy-%mm%-dd %hh:%nn:%ss) ( PROCESSTIMESTAMP_MOD) ;
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Why didn't you just add the function I posted as the derivation, that will work.
venkatvelpula
Participant
Posts: 80
Joined: Sat Mar 18, 2006 10:27 pm

Post by venkatvelpula »

I tried StringToTimeStamp('1900-01-01 00:00:00','%yyyy-%mm%-dd %hh:%nn:%ss') in the derivation of that column. I am getting the following fatal error ,

APT_CombinedOperatorController,0: Unrecognized timestamp format identifier: %45

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.
venkatvelpula
Participant
Posts: 80
Joined: Sat Mar 18, 2006 10:27 pm

Post by venkatvelpula »

I tried StringToTimeStamp('1900-01-01 00:00:00','%yyyy-%mm%-dd %hh:%nn:%ss') in the derivation of that column. I am getting the following fatal error ,

APT_CombinedOperatorController,0: Unrecognized timestamp format identifier: %45

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.
Post Reply