cast function in db2

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
SagarMelam
Participant
Posts: 26
Joined: Mon Apr 21, 2008 4:03 am
Location: Amalapuram

cast function in db2

Post 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.
Sagar
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Not CAST. CAST changes data type. Use one of the functions that convert NULL to a non-null value.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post 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.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post 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.
Mamu Kim
Post Reply