Page 1 of 1

cast function in db2

Posted: Wed May 27, 2015 2:06 pm
by SagarMelam
Hi,
can i use cast function to fetch a non nullable column to make it as nullable while extracting from a db2 connector to a dataset.

Posted: Wed May 27, 2015 4:18 pm
by ray.wurlod
Not CAST. CAST changes data type. Use one of the functions that convert NULL to a non-null value.

Posted: Thu May 28, 2015 1:58 pm
by priyadarshikunal
not null to null? no function or transformation required. just map it to nullable column.

or if its null to not null, read Ray's reply.

Posted: Thu May 28, 2015 8:39 pm
by kduke
I see this all the time. They use NVL or something to scrub nulls. One guy did it on 1000 columns. His SQL was over 32K. Found a bug in that Oracle stage where it truncated it. So afraid to deal with nulls within DataStage itself. Really sloppy. Poor practice.