Page 1 of 1

cannot insert null

Posted: Thu Aug 26, 2004 1:10 pm
by bobby
hi,
I have a Hash file with enbaled cache write from source for delta when i was trying to compare on order id like 3 rows cannot be compared and job
finish with this error,
CopyOfDIMSSWATORDER..Transformer_4: ORA-01400: cannot insert NULL into ("DWADMIN"."DIM_SSWAT_ORDER"."ORDER_ID")
plz guide
thanks
bobby

Posted: Thu Aug 26, 2004 1:18 pm
by kcbland
You're trying to insert a NULL value into a not-nullable column. I suggest you either put a constraint in the transformer to eliminate rows (use the ISNULL function) or find the reason you're getting nulls if they are not allowed in the data.

Posted: Thu Aug 26, 2004 1:32 pm
by bobby
My sql says no null on order_id

SQL> select order_id from dim_sswat_order
2 where order_id is null;

no rows selected

One thing more when u say constriant is the format of constriant like this
DSLinkhashfile.NOTNULL
Please suggest
Thanks
Bobby

Posted: Thu Aug 26, 2004 1:42 pm
by kcbland
I have no idea what you are talking about. Could you please post a description of your job designs.

If you have a reference lookup, then describe your job something like this:

I have a transformer reading from an ODBC stage, referencing a hash file and writing to another ODBC stage. A column is rejecting the row because it has a NULL value on a non-nullable column.

Read your DS manual for how to write a constraint in a transformer. You will do an ISNULL check for a NULL value.

Posted: Thu Aug 26, 2004 5:04 pm
by ray.wurlod
Without seeing your job design, I don't know whether this is appropriate advice. However...

By default, a sequential file stage maps "" to NULL. This might be the source of your nulls. You can alter this default behaviour on the Format tab.

Posted: Thu Aug 26, 2004 10:24 pm
by bobby
source --------transformation---------target
---------hash file
first i am populating the hash file with order id and then use same hash file for finding delta .
Thanks
Bobby [/u][/quote][/code]

Posted: Fri Aug 27, 2004 3:25 am
by ray.wurlod
Is the source from which you're reading, or the source from which you're loading the hashed file, a Sequential File?

Also, when you fail to find the key in a reference lookup, documented DataStage behaviour is to return NULL for all columns on the reference input link; if you don't check for this, you could be trying to insert NULL into your target.

Posted: Sat Aug 28, 2004 9:31 am
by bobby
HI,
I am having hash file which is populated from my source (first increment)
the hash file i am populating on column its not null ( like
20 rows from source 20 rows to hash file )(hash file write cache enabled)

step 2 ) same hash file then i am linking to transformer for finding delta
its giving that warnings. Plz advice.
Thanks
Bobby