Q

"Divisor is equal to zero" error

I am getting an "ORA-01476: divisor is equal to zero" error on a insert statement that does no dividing. Can you tell me why?

I am getting an "ORA-01476: divisor is equal to zero" error on a insert statement that does no dividing. Can you tell me why?
insert into ps_cm_perpadj_tmp (business_unit , inv_item_id , cm_dt_timestamp_p , 
cm_seq_nbr_p , cm_unit_cost_old , cm_unit_cost_povo , CM_UNIT_COST_VO , 
QTY_BASE , QTY_OWNED , CM_ADJUST_QTY , CM_WRITEOFF_QTY , CM_UNIT_COST , 
CURRENCY_CD) SELECT A.BUSINESS_UNIT , A.INV_ITEM_ID , A.CM_DT_TIMESTAMP_P , 
A.CM_SEQ_NBR_P , C.CM_UNIT_COST , A.CM_UNIT_COST_POVO , A.CM_UNIT_COST_VO , 
A.QTY_BASE , B.QTY_OWNED , 0 , 0 , 0 , D.BASE_CURRENCY FROM 
PS_CM_PERPAVGS_VW A , PS_BU_ITEMS_INV B , PS_CM_PERPCUR_VW C , 
PS_BUS_UNIT_TBL_IN D WHERE A.BUSINESS_UNIT = B.BUSINESS_UNIT 
AND A.INV_ITEM_ID = B.INV_ITEM_ID AND A.BUSINESS_UNIT = C.BUSINESS_UNIT 
AND A.INV_ITEM_ID = C.INV_ITEM_ID AND A.BUSINESS_UNIT = D.BUSINESS_UNIT 
AND A.BUSINESS_UNIT = :1

As can be seen by your INSERT statement, there is no division. So there are now two places to look. First, your INSERT statement is performing a SELECT statement. This SELECT statement has three components to the FROM clause. If one of those components is a view, it is possible that the view is performing an illegal division operation, hence the error. Or the view could be calling a function which is performing the division. Second,...

your table could have a trigger on it which is performing division. Check any views or triggers involved in the operation.

This was first published in July 2006
This Content Component encountered an error

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close