Error reading nullable date from sequential file

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
opdas
Participant
Posts: 115
Joined: Wed Feb 01, 2006 7:25 am

Error reading nullable date from sequential file

Post by opdas »

Hi,
We have problem in reading CSV sequential file. The date column is nullable and is a empty string when null. The null field value is set to "", the SQL Type set for the column is Date with length 10. The date format is %yyyy-%mm-%dd.
At field "dt": A fixed length field cannot have a "null_field" of length 0 on import
regards
Om
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The representation of NULL must have precisely 10 characters if you have specified that the field width is 10.

Otherwise read the field as VarChar, and convert it to Date subsequently. VarChar can legitimately have a value whose length is zero. Date can not. Any specified in-band null (representation of null) must be a legitimate value for the data type.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
opdas
Participant
Posts: 115
Joined: Wed Feb 01, 2006 7:25 am

Post by opdas »

Well I guess thats the only way around.
Thanks for your time.

Regards
Om
John Smith
Charter Member
Charter Member
Posts: 193
Joined: Tue Sep 05, 2006 8:01 pm
Location: Australia

Post by John Smith »

Or you could always have a default low value for any null dates
eg. 0001-01-01
provided your application/database allows that.This is similar to how we have high value dates e.g 9999-12-31
opdas
Participant
Posts: 115
Joined: Wed Feb 01, 2006 7:25 am

Post by opdas »

True, it would be better having a low value like you have suggested but we dont have control over the source feed :? .

Regards
Om
Post Reply