Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report Builder - error: divizion by 0

Status
Not open for further replies.

mariacri11

Programmer
Apr 9, 2003
22
0
0
CY
Sometimes, when I run a report a error occurs: divizion by 0 or zomething like this. Then you can debug a oracle program with Visual C++ or so I think. The fact is that few times the report runs OK. I have this problem with many reports, not only one. I use Oracle Reports 6i
 
This random error is data dependant.
If you have a calculation: X divided by Y and the value of Y is zero you will get this error.

To prevent this I generally write a function stored in the database that accepts the X and Y as input parameters. It then returns 0 if Y is zero otherwise it does the division and returns the result. That way when you need to perform a division you can code:
Code:
select F_DIVIDE(X,Y) division_result
from   .....
Hope that gets you started!

Code:
select * from Life where Brain is not null
Consultant/Custom Forms & PL/SQL - Oracle 8.1.7 - Windows 2000
[sup]When posting code, please use TGML to help readability. Thanks![sup]
 
Thanks, BJCopperIT,
But I don't think the error has something to do with the data I handle in the report. Running the form 6-7 times work fine, and, without any change in data, the 8th time (an example - actually it happends random) it crashes with division by zero - *Windows* error - and Reports closes. No Oracle error.
 
Afraid I cannot help with a Windows problem, perhaps a different forum? I am just curious, if the data doesn't change, why re-run the report?

Code:
select * from Life where Brain is not null
Consultant/Custom Forms & PL/SQL - Oracle 8.1.7 - Windows 2000
[sup]When posting code, please use TGML to help readability. Thanks![sup]
 
The error doesn't occur only after running one report. It can happen the first time I run a report or after running diferent reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top