Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Number / 0

RE: Number / 0

From: Hallas John <John.Hallas_at_O2.COM>
Date: Tue, 05 Mar 2002 07:13:30 -0800
Message-ID: <F001.0041F919.20020305071330@fatcity.com>

Sinardy

You are trying to create a function based index. To do so you need the query rewrite privilege
The index will still fail with a divide by 0 error (don't know why you are dividing by zero)

AS USER
create index wrong_logic on john(income/0) *
ERROR at line 1:
ORA-01031: insufficient privileges

AS SYS
SQL> connect internal
Connected.
SQL> grant query rewrite to user;

AS USER
SQL> create index wrong_logic on john(income/0); create index wrong_logic on john(income/0)

                                       *
ERROR at line 1:
ORA-01476: divisor is equal to zero

 1* create index wrong_logic on john(income/4) SQL> / Index created.

HTH John

-----Original Message-----
Sent: 05 March 2002 08:38
To: Multiple recipients of list ORACLE-L

Hi guys,

This is my test:

SQL> desc emp

 Name                                      Null?    Type
 ----------------------------------------- -------- ------------------------
----
 EMPNO                                     NOT NULL CHAR(3)
 NAME                                               VARCHAR2(10)
 INCOME                                             NUMBER(5)

SQL> create index no_logic on emp(income);

Index created.

SQL> drop index no_logic;

Index dropped.

SQL> create index wrong_logic on emp(income/0); create index wrong_logic on emp(income/0)

                                       *
ERROR at line 1:
ORA-01031: insufficient privileges

I don't understand why Oracle throw such exception (reply). Do you have any idea what is Oracle doing when Oracle find out number / 0

Sinardy



This electronic message contains information from the mmO2 plc Group which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email
(to the numbers or address above) immediately.

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Hallas John
  INET: John.Hallas_at_o2.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L

(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
Received on Tue Mar 05 2002 - 09:13:30 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US