Null Handling

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
reachmexyz
Premium Member
Premium Member
Posts: 296
Joined: Sun Nov 16, 2008 7:41 pm

Null Handling

Post by reachmexyz »

Hello all

I am trying to load 2 columns into a table. One of the columns can be null.in the xformer i have used NullToEmpty(FieldName) and loaded into database. When i query the database, i see <Null> in that field. I was expecting an empty string. I am not expecting <Null> as i have already handled it. Is Empty string not differenct from null?
Please reply
synsog
Premium Member
Premium Member
Posts: 232
Joined: Sun Aug 01, 2010 11:01 pm
Location: Pune

Re: Null Handling

Post by synsog »

What Database you are using as target?
reachmexyz
Premium Member
Premium Member
Posts: 296
Joined: Sun Nov 16, 2008 7:41 pm

Re: Null Handling

Post by reachmexyz »

Oracle 9i
reachmexyz
Premium Member
Premium Member
Posts: 296
Joined: Sun Nov 16, 2008 7:41 pm

Re: Null Handling

Post by reachmexyz »

reachmexyz wrote:Oracle 9i
Can somebody please help me on this
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Be patient, people post when they can - this isn't a 24 hour hotline. :?

Also, please learn to use the Reply to topic link, there's no need to quote something every dang time.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

While nulls and empty strings are two different things, Oracle is perfectly happy to turn one into the other. Add $APT_ORACLE_PRESERVE_BLANKS to your job and set it to "true", see if that helps.
-craig

"You can never have too many knives" -- Logan Nine Fingers
reachmexyz
Premium Member
Premium Member
Posts: 296
Joined: Sun Nov 16, 2008 7:41 pm

Post by reachmexyz »

chulett wrote:While nulls and empty strings are two different things, Oracle is perfectly happy to turn one into the other. Add $APT_ORACLE_PRESERVE_BLANKS to your job and set it to "true", see if that helps.
Thanks for the reply.
Unfortunately it is not working. what can i do more to make empty string stay as empty string instead of convertin to null.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Apparently the Reply to topic link is not working either. [sigh]

"Not working" doesn't really give us much to go on, how about more information? Say, your job design, stages used (particularly the target stage), settings there, etc etc etc. Details are your friend.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Sreenivasulu
Premium Member
Premium Member
Posts: 892
Joined: Thu Oct 16, 2003 5:18 am

Post by Sreenivasulu »

You need to give further details on the issue OR you yourself need to try with one column and observe the results.
Regards
Sreeni
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

reachmexyz wrote:Unfortunately it is not working.
:idea: "Not working" is the meaning of "unemployed".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Poovalingam
Participant
Posts: 111
Joined: Mon Nov 30, 2009 7:21 am
Location: Bangalore

Post by Poovalingam »

In Oracle, when you insert a empty string, this will be inserted as null I guess.

create table xx ( c1 varchar2(4));

insert into xx values ('');

select * from xx where c1='';
ans: no rows selected.

select * from xx where c1 is null;

Ans: c1
---
Post Reply