Skip to content
Advertisement

Syntax to resolve ORACLE error is ORA-01476: divisor is equal to zero

I’m using the NVL function to try and correct

ERROR: Error fetching from cursor. ORACLE error is ORA-01476: divisor is equal to zero.

I’m having trouble figuring out what the correct syntax is.

Advertisement

Answer

The normal method is nullif() in the dividend. So, instead of:

You would use:

Assuming that t.Amount is never negative or 0, it is sufficient to just drop the else 0:

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement