View Single Post
  #1 (permalink)  
Old 05-05-04, 17:34
pinecone pinecone is offline
Registered User
 
Join Date: Apr 2004
Posts: 51
Lightbulb ORA-01476: divisor is equal to zero

I have a stored procedure and inside I do

UPDATE answer SET
value = (select (number_system/v_total_no_system) * 100 from
answer)
where question_id = 50;

I got ORA-01476: divisor is equal to zero error.

The reason is number_system = 0 in that record.

Why when I manually do this below it doesn't return error?

SQL> select (0/2)*100 from dual;

(0/2)*100
----------
0

How can I resolve this error in stored procedure?

Thanks in advance!
Reply With Quote