Page 1 of 1

NULL values in the output

Posted: Fri May 09, 2008 8:36 am
by saini
Hi,

I am fetching col1,col2,col3 from database. In the database col1 and col2 aur not-nullable but when I import the metadata in DS it says these fields are nullable and when I try to write these coloums in a seq file along with the col value its inserting nulls(|) also in the flat file.

The datatype of col1 and col2 are char20.

INPUT

col1 col2
ABC XYZ


OUTPUT

col1 col2
ABC|||||||||||| XYZ||||||||||

I am getting '|' along with the output of the column.
I have tried handling the null values and making the coloums as nullable and not-nullable both ways but not able to remove the '|||'
Please suggest.

Posted: Fri May 09, 2008 9:00 am
by OddJob
I suspect this is because of your value for APT_STRING_PADCHAR. For a default install this will be set to NULL (0x00 in hex).

Add this variable to your job parameters and set to 0x20 i.e. space.

It may be helpful then to convert to a varchar in a transformer and perform a trim on the fields to remove (and keep removed) the trailing spaces.

Hope this helps!

Posted: Fri May 09, 2008 9:23 am
by saini
Thanks it worked