Discoverer divide by zero [message #223833] |
Sun, 11 March 2007 23:34 |
aankha
Messages: 8 Registered: January 2007 Location: Nepal
|
Junior Member |
|
|
I am using Oracle Discoverer Plus and I have some columns in the database table that periodically take the zero value. I have to use that column to divide other values. Is there any way I can handle this to show "0" when it is divided by zero?
Discoverer Plus help shows that PL/SQL functions can be used in calculations. But I can't find the Register PL/ SQL function option in the Tools menu. Help please!!
|
|
|
Re: Discoverer divide by zero [message #223854 is a reply to message #223833] |
Mon, 12 March 2007 01:57 |
skooman
Messages: 913 Registered: March 2005 Location: Netherlands
|
Senior Member |
|
|
You can create a calculation like:
decode(value1,null,0,(value2/value1))
Thus stating: if value1 equals null then return 0, if value1 is not null then divide value2 by value1. Variations on this theme can be done using CASE WHEN ELSE END.
The reference refering to the PL/SQL functions means that you can create a function in the database (ie "custom_divide"), register that in the EUL and use it in the Discoverer front end. But that seems a bit overdone just to avoid a divide by zero...
|
|
|
|
|
|
|
|