Null handling for CHAR + nullable field
Moderators: chulett, rschirm, roy
Null handling for CHAR + nullable field
Hi,
I am reading pipe delimited file and loading data to Teradata by parsing data through schema file. (Generic job)
The job is failing with warnings, The input looks like below. (No NULL, No Space)
AAA||BBB|C|C
BBB||CCC|D|E
At target the datatype is CHAR(1) NULLABLE.
When I parse data through schema file for the second field, the job generates warnings.
I have tried adding APT_STRING_PAD_CHAR environment variable with values 0x0 and 0x20, but doesn't seem to be working.
PARAS: NULLABLE string[1];
Please help me to resolve this issue.
I am reading pipe delimited file and loading data to Teradata by parsing data through schema file. (Generic job)
The job is failing with warnings, The input looks like below. (No NULL, No Space)
AAA||BBB|C|C
BBB||CCC|D|E
At target the datatype is CHAR(1) NULLABLE.
When I parse data through schema file for the second field, the job generates warnings.
I have tried adding APT_STRING_PAD_CHAR environment variable with values 0x0 and 0x20, but doesn't seem to be working.
PARAS: NULLABLE string[1];
Please help me to resolve this issue.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Anton - a CHAR field is fixed length. It can only be either NULL or a specific number of characters. In this case, since it is CHAR(1), it is scarfing up one of your delimiters as data, throwing everything else off.
In this case, if the data supplier is using the empty string ("") to represent NULL, then what Ray/Craig are saying is that you have to specify that in the schema for the file. There is no default definition, since technically NULL is more of a database concept.
In this case, if the data supplier is using the empty string ("") to represent NULL, then what Ray/Craig are saying is that you have to specify that in the schema for the file. There is no default definition, since technically NULL is more of a database concept.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Augmenting what Andy said, DataStage requires that the Null Field Value have the same length as a Char data type field. You can get around this by declaring it to be VarChar, and sorting it out afterwards.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.