I need help in Null handling, here are the details:
I am extracting data from one Teradta system using Fast export, copy data to a mainframe dataset, and want to Load to another Teradata system.
There are few different data types CHAR,VARCHAR, DECIMAL(13,2) fields, and to account for Nulls, i use following in extract:
/* High values are substituted for Nulls. */
SELECT A.FIELD1 ,A.FIELD2 ,COALESCE(A.FIELD3,X'FF') (CHAR(06)) ,A.FIELD4 ,COALESCE(A.FIELD5,X'FF') (CHAR(16)) ,CAST((CASE WHEN A.FIELD6 IS NULL THEN X'FF' ELSE ' ' END) AS CHAR(01)) ,COALESCE(A.FIELD6, 99999999999.99) FROM DB.TableName
Once Records are extracted, i used following Layout to read it:
but last colum goes to Error table with Error code 2679.
Question is: how do i handle DECIMALs and VARCHARs when there is a Null in the source table. If i dont handle them, then when I Export to a dataset, it saves it as a SPACE, and then gets loaded to table as SPACE instead of Nulls.