handling nulls in 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
dsdev_123
Participant
Posts: 25
Joined: Tue Oct 09, 2007 9:13 pm

handling nulls in timestamp

Post by dsdev_123 »

hi i have a problem where i have a column SHP_DT which is a time stamp and i have to handle null and defualt it to a constant value by using modify stage

i was trying
SHP_DT(outcolumn)=handle_null(SHP_DT, " ")
its throwing error saying it is a bad literal
can any body throw some light

thanks
mhester
Participant
Posts: 622
Joined: Tue Mar 04, 2003 5:26 am
Location: Phoenix, AZ
Contact:

Post by mhester »

I believe you can add the environment variable -

APT_IMPEXP_ALLOW_ZERO_LENGTH_FIXED_NULL.

From the Parallel Job Advanced User Guide -
When set, allows zero length null_field value with fixed length fields. This
should be used with care as poorly formatted data will cause incorrect
results. By default a zero length null_field value will cause an error.
Timestamps are fixed width and this should take care of your problem.

Regards,
mhester
Participant
Posts: 622
Joined: Tue Mar 04, 2003 5:26 am
Location: Phoenix, AZ
Contact:

Post by mhester »

I think I missed the mark on my previous post. This would work when defined in the schema and read via a stage. Obviously you are past that point and using the modify stage.

Sorry
throbinson
Charter Member
Charter Member
Posts: 299
Joined: Wed Nov 13, 2002 5:38 pm
Location: USA

Post by throbinson »

You must modify a NOT NULLABLE column to be within the domain of the defined datatype. A column defined as a NOT NULL timestamp must be a timestamp. A space or empty is not a valid timestamp.
Can you use a default out of bounds value that is a Timestamp? Like 9999-12-31 23:59:59? (Teradata) to represent NULL? BTW - your default format may be different. Or can you define it as nullable? Or as a varchar?
Post Reply