DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: ORA-01476: divisor is equal to zero

  1. #1
    Join Date
    Aug 2000
    Posts
    132
    Any suggested workaround for this? I'm generating reports where I want to divide by zero - Oracle's suggested workaround is to substitute 1 for 0 - but this would create false statistics for my reports.

  2. #2
    Join Date
    Oct 2000
    Location
    Cambridge, MA (Boston)
    Posts
    144
    the question seems to be what do you want a divide by zero to represent? a reallyreallyreally big number? you can't really divide by zero in any practical sense.

    d.

  3. #3
    Join Date
    Nov 2000
    Location
    Baltimore, MD USA
    Posts
    1,339
    DBAtrix is certainly correct. The question is what you expect the result to be when a value is divided by 0. There are mathematical arguments for both infinity and undefined. We have no way to represent infinity, but we do have NULLs to represent undefined. Therefore, the standard way this is handled is:

    SELECT
    ---:Numerator / DECODE ( :Denominator, 0, NULL, :Denominator)
    FROM
    ---DUAL

    Hope this helps,

    - Chris

  4. #4
    Join Date
    Aug 2000
    Posts
    132
    thx DBAtrix and chrislong - i was approaching the problem from the wrong angle

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width