Page 1 of 1

Division by Zero

Posted: Fri Jan 11, 2013 4:37 pm
by sgubba
Hi all,

In one of my job I got this warning message

analyzeAndPrepare:divisor is 0.

I suppressed the warning and ran the job

The next job which is a load job is failing with
Unable to insert a record into the table due to ORA-01722: invalid number


Is this error because of the divison by 0 warning

What values Datastage assigns when Divison by zero happens

Posted: Fri Jan 11, 2013 6:38 pm
by ray.wurlod
Division by zero is undefined. Therefore it does not make sense to ask what value gets assigned. DataStage (correctly) throws an exception. It's up to you to check the divisior if there's any chance of it being zero.

Code: Select all

If Qty = 0 Then 0 Else TotalPrice / Qty

Posted: Sat Jan 12, 2013 1:07 pm
by sgubba
Thanks Ray

I will certainly handle that division by zero

My question is will it assign a non numeric character

I want to know if this column is the issue or
there is another column that causing the issue of inserting non numeric to a numeric column

Regards

Posted: Sat Jan 12, 2013 2:36 pm
by chulett
More than likely that is the issue. Fix the division error and you'll see.

Posted: Sat Jan 12, 2013 3:34 pm
by ray.wurlod
You can generate any value that's legal for the data type of the target column.