RE: Operator and condition precedence
Date: Wed, 9 Sep 2009 08:17:08 -0500
Message-ID: <C970F08BBE1E164AA8063E01502A71CF0154F69C_at_WIN02.hotsos.com>
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_at_gmail.com]
Sent: Tuesday, September 08, 2009 10:19 PM
To: Ric Van Dyke
Cc: rjoralist_at_society.servebeer.com; 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
-- http://www.freelists.org/webpage/oracle-lReceived on Wed Sep 09 2009 - 08:17:08 CDT
