Page 1 of 1

Null handling issue

Posted: Wed Nov 03, 2010 3:19 pm
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.

Posted: Thu Nov 04, 2010 12:53 am
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?

Posted: Thu Nov 04, 2010 9:44 am
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.