Hi, We are reading the source file in VarChar Format & performing the column metadata conversion in transformer as per the target metadata. In one of the file, a column is Null in Source file. The target for this column is Timestamp. I have tried all ways of Null Handling, assigning default and converting the column to setNull, but in all the ways its givig me warning & the record is getting dropped.
Is there anyway that the Null from source gets converted to Null to target for the timestamp column without giving warning and dropping the record ?
String to Timestamp Conversion having Null in Source
Moderators: chulett, rschirm, roy
What exactly is the warning you are receiving?
Seeing as the source is a sequential file, is the "null" column actually an empty string (0 bytes in length) or nothing but spaces or other character value? If so, then you could simply check for that condition. For instance, if an empty string or only spaces represents a null value:
If trim(input.date)='' then setNull() else StringToTimestamp(input.date,format_string)
Making certain, of course, that the output column is a nullable Timestamp.
Regards,
Seeing as the source is a sequential file, is the "null" column actually an empty string (0 bytes in length) or nothing but spaces or other character value? If so, then you could simply check for that condition. For instance, if an empty string or only spaces represents a null value:
If trim(input.date)='' then setNull() else StringToTimestamp(input.date,format_string)
Making certain, of course, that the output column is a nullable Timestamp.
Regards,
- james wiles
All generalizations are false, including this one - Mark Twain.
All generalizations are false, including this one - Mark Twain.
Hi,
I have done the above code. But got warning.
APT_CombinedOperatorController(0),0: Conversion error calling conversion routine timestamp_from_string data may have been lost
My Source value is Null or ''. I did implement handing both the cases.
Whatever change i am doing, but i am getting this warning. Is there anyway or any code that i can use and do not get this warning.
I have done the above code. But got warning.
APT_CombinedOperatorController(0),0: Conversion error calling conversion routine timestamp_from_string data may have been lost
My Source value is Null or ''. I did implement handing both the cases.
Whatever change i am doing, but i am getting this warning. Is there anyway or any code that i can use and do not get this warning.
ANSHUL