cannot insert null

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
bobby
Participant
Posts: 86
Joined: Mon Jul 19, 2004 8:31 pm

cannot insert null

Post 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
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post 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.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
bobby
Participant
Posts: 86
Joined: Mon Jul 19, 2004 8:31 pm

Post 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
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post 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.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
bobby
Participant
Posts: 86
Joined: Mon Jul 19, 2004 8:31 pm

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

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
bobby
Participant
Posts: 86
Joined: Mon Jul 19, 2004 8:31 pm

Post 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
Post Reply