Home » Developer & Programmer » Forms » Calculation Problem...
Calculation Problem... [message #82064] Thu, 17 April 2003 03:09 Go to next message
Muzzammil
Messages: 99
Registered: February 2003
Member
Hi experts,

I have few fields like stockb1, stockb2, stockb3, stockb4 and TotalStock. The stockb1,2,3,4 are sum(qty) from stock table.

The problem is the Totalstock is coming if there is values in stockb1,2,3,4, else if any of the field contain 0 or null the total is coming 0. Even if I aply NVL also its coming the same.

The error I am getting is:
FRM-40735:WHEN-BUTTON-PRESSED trigger raised unhandled excetion ORA-01476.

The calculation I made is:

:TSTOCK:=(nvl(:RSTOCK,0)+nvl(:JSTOCK,0)+nvl(:KSTOCK,0)+nvl(:QSTOCK,0)+nvl(:DSTOCK,0));

Please solve this problem.

Thanks
Syed Muzzammil.
Re: Calculation Problem... [message #82069 is a reply to message #82064] Fri, 18 April 2003 04:48 Go to previous messageGo to next message
rm
Messages: 4
Registered: April 2003
Junior Member
U can give the initial value property as 0 (zero) for all items. U will not get any problem.
Re: Calculation Problem... [message #82083 is a reply to message #82064] Fri, 18 April 2003 10:04 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
Are you sure that's all the calculation that is performed ?
Is there not any other function/trigger/procedure that uses TSTOCK ??
ORA-01476: Divisor equal to zero
I think you use TSTOCK as a divisor (you divide something by tstock: x/tstock) in another piece of code !

hth
Frank
Re: Calculation Problem... [message #82086 is a reply to message #82064] Sat, 19 April 2003 00:52 Go to previous message
Muzzammil
Messages: 99
Registered: February 2003
Member
Thankx, yes I was dividing TSTOCK/SALES in the same procedure to get StockAVG. When I remove this I got results.

If I will give like this the error is coming and it is compulsory for me to divide the TSTOCK/SALES to get StockAVG what should I do.

Regards,
Syed Muzzammil.
Previous Topic: menu
Next Topic: PLL referring PLL with hardcoded path
Goto Forum:
  


Current Time: Sun Jun 30 02:59:48 CDT 2024