ORA-01476: divisor equal to zero
When I try to run this query I get error 'ORA-01476: divisor equal to zero'. How can I write the query so it understand that it not should use Sum(SalesQuantity)=0 And Sum(Net_Sales)=0 in the Case?
SELECT year_month, customer,
(Sum(Case When record_type NOT IN ('B', 'E') And NET_SALES <> '0' Then NET_SALES Else Null End)/
Sum(Case When record_type NOT IN ('R', 'P') And SALES_QUANTITY <> '0' Then SALES_QUANTITY Else Null End)) As Test
Where Period_date Between to_date('2007-01-01','yyyy-mm-dd') And to_date('2007-09-30','yyyy-mm-dd')
FROM tbltest
Group By year_month, customer
I generally use
whatever / NULLIF(expression, 0)Message was edited by:
William Robertson
Similar Messages
-
ORA-01476: divisor is equal to zero Error in tabular form
Hello,
My tabular form will give me this error sometimes: Error in add row internal routine: ORA-01476: divisor is equal to zero. I don't understand what causes it. On the form I have a on load - before header process that will add 5 blank rows automatically, which was wizard generated. This error doesn't always happen, when I turn off this process and then turn it back on it works fine. Currently I have to set the condition to never, so I don't get the error. Is this a bug with Apex?
Also, when there is data available I have to click on the next arrow for the data to display.
Please advise.
Thanks,
Mary
Edited by: MaryM on Feb 26, 2010 9:49 AM
Edited by: MaryM on Mar 2, 2010 11:16 AMHello,
I have the same error message for ADD ROWS in tabular form. It is also happens when I try to open one empty record using On Load when page rendered. Have you found a fix for that ?
Thanks,
Marina -
BI Report Error:ORA-01476: divisor is equal to zero
I have written the Query containing the Pl/SQL procedures and is working fine when executed ,but when I am using the same query for the BI Publisher report , in the Runtime the report is giving error *"ORA-01476: divisor is equal to zero"* .
Please provide me with the answers and help ,as it is most important for me to get it solved.Hi,
Try this...
case when nvl(Y,0) = 0 then 0 else (X/Y) end
Replace your columns in place of X and Y in your query..
hope helps you....
Cheers,
Aravind -
Ora-01476 divisor is equal to zero
hi!
ROUND(SUM(VALOR_VDA) / SUM(DECODE(QTDE_VDA,0,1,QTDE_VDA)),2)
Oracle 10.2.0.1.0
Red Hat Enterprise 5is this QTDE_VDA field numeric
The only issues here with the decode is see is if the total value of all the rows when summed is 0 - zero then you will have zero-divide error
SS
Message was edited by:
user478316 -
Error in add row internal routine: ORA-01476: divisor is equal to zero
Hi,
I am using Tabular Form Report in my application. So, when the user enters the page for the first time, no fields appear (if he has previously not entered any values in the DB). So to avoid this I added a Data Manipulation process-> Add rows to tabular Form ->On load after footer, so that when the user logins whether he entered previous values or not, he can see some empty fields, but this is not working as expected.
Any ideas how to resolve this issue.Hmm other people have had this errorm found this hope it helps,
Hi,
Have a look at: Re: Add Row in detail table when check box is checked on a master report table as this shows how you can use javascript to clone a row -
Getting ORA-01476 and ORA-06512 in alert log
I am getting this error in my alert log file frequently
ORA-12012: error on auto execute of job 734
ORA-12008: error in materialized view refresh path
ORA-01476: divisor is equal to zero
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 803
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 860
ORA-06512: at "SYS.DBMS_IREFRESH", line 683
ORA-06512: at "SYS.DBMS_REFRESH", line 195
ORA-06512: at line 1
can anybody help in finding the cause and solution for this?
Thanks and Regards
Thiagarajan.The root error for this issue can be found here:
ORA-01476: divisor is equal to zero
You should debug your materialized view, it is dealing with divisors whose value is equal to zero, and your procedure isn't capable of handling this exception. Try to perform a manual refresh to verify this error is repeatable and look for division operations, then debug values.
~ Madrid -
How can i resolve divisor is equal to zero
hi,
i have the situation like i am calculating the column values. in that one field divided by other. but in that divisor field have zero. for that it's giving the error.
please help to do so...
example: select 8/o from dual;
error: ora-01476divisor equal to zeroindra wrote:
i have the situation like i am calculating the column values. in that one field divided by other. but in that divisor field have zero. for that it's giving the error.Either exclude it by adding:
divisor != 0to WHERE clause or use:
CASE divisor
WHEN 0 THEN whatever_result_you_want_for_zero_divisor
ELSE divident / divisor
ENDSY.
Edited by: Solomon Yakobson on Sep 19, 2011 6:47 AM -
Hi all.
I tried to get a tablespace and fragmentation information with blow script.
But I got an error(ORA-1476 : divisor is equal to zero)
How can I fix the script properly ?
Could anybody help me to fix the script?
Thanks in advance.
select tablespace_name,sum(obj_cnt) object_count,sum(ini_ext) init_ext,sum(nex_ex
t) next_ext,sum(byte)/1048576 bytesize,
(sum(byte)/1048576)- (sum(fbyte)/1048576) byteused,sum(fbyte)/1048576 bytefree,
sum(frags), sum(largest)/1048576 avail,
(sum(fbyte)/sum(byte))*100 free
from (select tablespace_name,0 obj_cnt,0 ini_ext,0 nex_ext, 0 byte, sum(bytes) fb
yte, count(*) frags, max(bytes) largest
from dba_free_space
group by tablespace_name
union
select tablespace_name,0, 0, 0, sum(bytes), 0, 0, 0 from dba_data_files
group by tablespace_name
union
select tablespace_name, 0, initial_extent/1024 ini_ext, next_extent/1024 nex_ext,
0,0,0,0
from dba_tablespaces
union
select tablespace_name, count(*) obj_cnt, 0, 0, 0, 0, 0, 0
from dba_segments
group by tablespace_name)
group by tablespace_nameThe various NVL and DECODE solutions may get rid of the error, but will not get you the correct answer. By the way, you may want to look at the differences in behaviour between
(sum(fbyte)/decode(sum(byte),0,NULL))*100 free and
(sum(fbyte)/decode(sum(byte),0,1))*100 free before you use either.
Your real problem is that you have a temp tablespace using temporary files. This is the right thing to do, but, you need another union in your statement, to access dba_temp_files:
SELECT tablespace_name,SUM(obj_cnt) object_count,
SUM(ini_ext) init_ext, SUM(nex_ext) next_ext,
SUM(byte)/1048576 bytesize,
(SUM(byte)/1048576)- (SUM(fbyte)/1048576) byteused,
SUM(fbyte)/1048576 bytefree, SUM(frags), SUM(largest)/1048576 avail,
(SUM(fbyte)/SUM(byte))*100 free
FROM (SELECT tablespace_name, 0 obj_cnt, 0 ini_ext, 0 nex_ext, 0 byte,
SUM(bytes) fbyte, COUNT(*) frags, MAX(bytes) largest
FROM dba_free_space
GROUP BY tablespace_name
UNION ALL
SELECT tablespace_name,0, 0, 0, sum(bytes), 0, 0, 0
FROM dba_data_files
GROUP BY tablespace_name
UNION ALL
SELECT tablespace_name,0, 0, 0, sum(bytes), 0, 0, 0
FROM dba_temp_files
GROUP BY tablespace_name
UNION ALL
SELECT tablespace_name, 0, initial_extent/1024 ini_ext,
next_extent/1024 nex_ext, 0,0,0,0
FROM dba_tablespaces
UNION ALL
SELECT tablespace_name, COUNT(*) obj_cnt, 0, 0, 0, 0, 0, 0
FROM dba_segments
GROUP BY tablespace_name)
GROUP BY tablespace_nameYou should also use UNION ALL instead of UNION, because UNION implies a sort distinct, whil union all does not. The sort is unneccessary, and the distinct may cause you to lose rows.
TTFn
John -
Divisor is equal to zero in date function
Hi
I have used a query like this but am getting error like divisor is equal to zero
with s_mon as (select to_char(add_months(trunc(sysdate,'rr'),level-1),'Mon-RR') month from dual connect by level <=12)
select s_mon.month,
tgdate
from abc ,s_mon
where to_char(tgdate(+),'Mon-RR')=s_mon.month
Result should be like this
month tgtdate
jan-12 01-01-12
feb-12 05-02-12
mar-12
apr-12
dec-12
Edited by: vishnu prakash on 27-May-2012 00:32Vishnu,
I did not get any error for the below statements; Does this not match with yours? If not, then please post your table structure, data and the exact query in which you are facing error.
drop table test_table;
create table test_table (pk_col number, col date);
insert into Test_table values (3, to_date('MAY-2012', 'MON-RR'));
insert into Test_table values (4, to_date('DEC-2012', 'MON-RR'));
select * from test_table;
with t as
select to_char(add_months(trunc(sysdate, 'rr'), level - 1), 'MON-RR') month
from dual
connect by level <= 12
select b.month, a.col
from test_table a,
t b
where to_char(a.col(+), 'MON-RR') = b.month
MONTH COL
APR-12
AUG-12
DEC-12 01-DEC-12
FEB-12
JAN-12
JUL-12
JUN-12
MAR-12
MAY-12 01-MAY-12
NOV-12
OCT-12
SEP-12 Regards,
P. -
HP QUERY DATA ERROR((SQLER=ORA01476 divisor is equal to zero
Experts,
We are seeing the following error in Inventory Optimization Horizontal Plan
HP QUERY DATA ERROR((SQLER=ORA01476 divisor is equal to zero
Navigation
Sign on as Inventory Planner responsibility, Inventory Plan > Workbench
Select the plan owning org, so you can see all orgs.
View by organizations
Select org: <Org Code>
Select Category <category>,
item <Item name
Right click, select Horizontal Plan > Default
Can you help please.Well the easiest way to troubleshoot this problem would be to find the row where FBASEVOLTAGE = 0. Something like this maybe:
SELECT BV.FBASEVOLTAGE
, FB.FMAGNITUDE_RESULT
, BS.IUBUSNO
FROM GN
JOIN GM ON GM.IELEMENT_MAP_ID = GN.IELEMENT_MAP_ID
JOIN BS ON GM.NPS_ELEMENT_ID = BS.IUBUSID
AND GM.NPS_ELEMENT_TYPE = 101
JOIN CONFIG_BASE_VOLTAGE BV ON BS.IBASEVOLTAGEID = BV.IBASEVOLTAGEID
JOIN FACT_BUS FB ON FB.IBUS_NO = BS.IUBUSID
AND FB.IPS_CASE_ID = GN.IPS_CASE_ID
WHERE BV.FBASEVOLTAGE = 0
AND GN.IPS_CASE_ID = 1637
; -
Divisor is equal to zero error
Hi, I am getting divisor is equal to zero error while doing a calculation using sql. Is there a workaround this ?
ThanksWhat do you want to do, if the divisor is 0?
Is the SQL executed in SqlPlus or in a procedure/function?
Hi, I am getting divisor is equal to zero error while doing a calculation using sql. Is there a workaround this ?
Thanks -
I wrote this line in formula
(:stot1+ :bottomcost.cmt1+ :bottomcost.cf1+ :bottomcost.oh1+ :bottomcost.ins1+ :bottomcost.naf1 + :bottomcost.com1) / nvl(:exc_rate,0)
and there is no 0 Value but when I execute query then return this error
FRM-40735
ORA-01476I wrote this line in formula
(:stot1+ :bottomcost.cmt1+ :bottomcost.cf1+
:bottomcost.oh1+ :bottomcost.ins1+ :bottomcost.naf1 +
:bottomcost.com1) / nvl(:exc_rate,0)
and there is no 0 Value but when I execute query then
return this error
FRM-40735
ORA-01476Never use / nvl(:exc_rate,0)
If :exec_rate is null then you will get that error. Instead you use / nvl(:exc_rate,1) so if your divisor is = to zero you will return the value itself without dividing.
Regards,
Tony -
How can I set my y-intercept (b) equal to zero retina macbook 2014
Hello everyone,
I hope you can reply to my question before 11:55p.m. today because that is when my report is due. I graphed my scatter plot and got my trend line, but my professor wants the class to set the y-intercept, the (b) from y=mx+b to zero. Can you guide me step by step on how to do that? I tried clicking on the Data section, then x-value, typed zero, but my graph disappeared. I am supposed to be using Excel for this, but I only have numbers. Can you set the y-int equal to zero using Numbers as well?Hi Theonlymary,
The LINEST function returns an array of the statistics for a straight line that best fits the given data using the least squares method.
LINEST(known-y-values, known-x-values, nonzero-y-intercept, more-stats)
Type = in a spare cell to bring up the Function Panel. Type LINEST in the search box to see help on that function.
I don't use LINEST but it seems you can get extra stats from an array that it returns.
It won't change your graph (it doesn't need a graph).
Regards,
Ian. -
Manual accrual net value equal to zero
Hi SD gurus,
i'm creating manual accrual SD document strating from rebate agreement.
The value of the document created is equal to zero and i found no way to correct this; the strange is that i'm able to invoice the document and to post it in FI and the values of Rebate are correctly updated.
can anyone suggest any trick or oss notes?
Thanks a lot and regards
C*well u can trouble shoot for ur self
in sales order select the item double click on it choose conditions in this tab down there is analysis click on tht
in analysis on left hand side ur with ur pricing procedure ok
select ur price cond ( pr00 ) then open the treee and slect the cond rec and read the message on right hand side...
it says con rec missing or found or ignored depending on tht u can slove ur problem . -
Produciton order status TECO, but WIP is not equal to zero
Dear Expert,
In OKGC,
1000 0 000002 REL 2 WIP Calculation on Basis of Actual Costs
1000 0 000002 DLV 3 Cancel Data of WIP Calculation and Results Ana
1000 0 000002 PREL 1 WIP Calculation on Basis of Actual Costs
*1000 0 000002 TECO 4 Cancel Data of WIP Calculation and Results Ana
We checked produciton order status TECO (CO03)
but WIP is not equal to zero (KKAO)
Also, we found production order status show "rel" status in KKAO.
Why order status in CO03 is TECO, but show "REL" in KKAO?
Thanks in advance.Hi,
We also had similar issue that the WIP is not equal to zero even though the status of the Process Order is DLV/TECO. When we analyzed, we found that few of the operations/resources/activityeps are not yet confirmed in the same month for the order. These operations/resources/activityeps are confirmed in subsequent month, then WIP got automatically Zero.
Also refer the SAP Note 530563 - WIP calculation: Status DLV and TECO. Which provide the details for how WIP will get calculated.
Thanks & regards,
ADI
Maybe you are looking for
-
Hope Someone at Apple read this
One month ago i've recived a new 23'' Apple monitor and soon i've noticed one pixel (in the center bottom of the display) not working properly. I said one is not too bad! but now that i'm writing the pixels not working properly are growing in the sam
-
Lock box jobs getting cancelled
Hello All, I am new to lockbox processing. I am into lock box support project now. Recently lot of lock box jobs are getting cancelled. While I am going through job log it says that " Payment advice 01706525923 does not exist for account 10001009 011
-
How to set default permissions for files and folders
We have mac and windows computers on a network where we use Mac OSX Server 10.4 to share files. When files are created on windows computer, no problem, all users can read/write these files. However on our 2 macs (1 10.3 and 1 10.4), other users are b
-
System : PIX 506E ver 6.3(5) PDM 3.0(4) XP SP3 Firefox 3.0.8 and IE 6 BOTH have the same result so it is not a browser setting. JRE 6 update 11 would log errors but open the PDM. Updating java uninstalls update 11 and installs update 13. This update
-
I have nokia 2700 classic and after firmware update the phone can't recognize the sd nokia card. I tried with a diferrent card too and ocurres the same. If someone knows about this issue , i will appreciate it. thanks