RE: Operator and condition precedence

  • From: "Ric Van Dyke" <ric.van.dyke@xxxxxxxxxx>
  • To: "Michael Moore" <michaeljmoore@xxxxxxxxx>
  • Date: Wed, 9 Sep 2009 08:17:08 -0500

Right you are:

 

SQL> select * from dual

  2  where 'xyz'='' and to_number('abc') > 0;

where 'xyz'='' and to_number('abc') > 0

                             *

ERROR at line 2:

ORA-01722: invalid number

 

SQL>

SQL>

SQL> explain plan for

  2  select * from dual

  3  where 'xyz'='' and to_number('abc') > 0;

SQL> select * from table(dbms_xplan.display);

 

PLAN_TABLE_OUTPUT

------------------------------------------------------------------------
----

------------------------------------------------------------------------
----

------------------------------------

Plan hash value: 3752461848

 

------------------------------------------------------------------------
---

| Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time
|

------------------------------------------------------------------------
---

|   0 | SELECT STATEMENT   |      |     1 |     2 |     2   (0)|
00:00:01 |

|*  1 |  FILTER            |      |       |       |            |
|

|   2 |   TABLE ACCESS FULL| DUAL |     1 |     2 |     2   (0)|
00:00:01 |

------------------------------------------------------------------------
---

 

Predicate Information (identified by operation id):

---------------------------------------------------

 

   1 - filter(TO_NUMBER('abc')>0 AND 'xyz'='')

 

-----------------------

Ric Van Dyke

Hotsos Enterprises

-----------------------

 

Hotsos Symposium 

March 7 - 11, 2010 

Be there.

 

 

________________________________

From: Michael Moore [mailto:michaeljmoore@xxxxxxxxx] 
Sent: Tuesday, September 08, 2009 10:19 PM
To: Ric Van Dyke
Cc: rjoralist@xxxxxxxxxxxxxxxxxxxxx; Oracle L
Subject: Re: Operator and condition precedence

 

Ric,
On my system
 

        
        select * from dual
        where 'xyz'>'' and to_number('abc') > 0;

throws a numeric error 

 

        
        Mike

         

         

 

Other related posts: