Q
Problem solve Get help with specific problems with your technologies, process and projects.

"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.

Dig Deeper on Oracle database design and architecture

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide.com

SearchDataCenter

SearchContentManagement

SearchHRSoftware

Close