Null handling issue

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
GowthamSen
Participant
Posts: 21
Joined: Tue Nov 02, 2010 2:36 pm
Location: India

Null handling issue

Post by GowthamSen »

I defined a source as a sequential file where one column is set as Nullable "No".

The data is coming correctly. But when I load the data into database, I can see some null values. (The data is being loaded as the column is defined as nullable in database oracle).

So I want to replace the null value with a pre-defined string. Before that, I want to trim first and then check for null values.

So, first, i am trying to trim the string. I used function as follows in specifications for MODIFY stage.
ADDR_1=STRING_TRIM[NULL,end](ADDR_1)

When I execute the job, I am getting the following error:

OC_LOAD_TUTORIAL_TBL: ?? (IIS-CONN-DAAPI-000398; Schema reconciliation detected a size mismatch for column ADDR_1. When writing column VARCHAR(min=0) into database column VARCHAR(min=0,max=30), truncation, loss of precision or data corruption can occur.; CC_DBSchemaRules; reportSizeMismatch; CC_DBSchemaRules.cpp; 1,575)

Am I missing anything here.

Thanks a lot in advance.
Thank you,
Regards

Gowtham
(Learning DS)
nitkuar
Participant
Posts: 46
Joined: Mon Jun 23, 2008 3:09 am

Post by nitkuar »

I want to trim first and then check for null values
empty string and null are two different things.

If you are using modify stage just for this purpose, I don't think its a good idea. Moreover as you have mentioned that in source sequential you defined that column as nullable No, then in that case you can't get values from source.
Also you have mentioned that in Oracle you are able to see blank values. Are you sure that those are NULL values or they could be empty strings as well?
GowthamSen
Participant
Posts: 21
Joined: Tue Nov 02, 2010 2:36 pm
Location: India

Post by GowthamSen »

Thanks for your reply.
nitkuar wrote:
Also you have mentioned that in Oracle you are able to see blank values. Are you sure that those are NULL values or they could be empty strings as well?
Yes, I execute the query with condition as Where ADDR_1 Is null in oracle database. It returned many records.
Thank you,
Regards

Gowtham
(Learning DS)
Post Reply