Re[7]: to_number question

  • From: Peter Robson <pgro@xxxxxxxxx>
  • To: Jonathan Gennick <oracle-l@xxxxxxxxxxxxx>
  • Date: Wed, 21 Jul 2004 12:53:10 +0100

 Jonathan,

Err, I decided to replicate your query - no error ... odd. Am I
missing something? Here below is a log of my session. Its Ora v 8.1.7.

peter
.........


SQL> create table subtest
  2  (flag char(1),
  3   num varchar2(10));

Table created.

SQL> insert into subtest values ('A',3);

1 row created.

SQL> insert into subtest values ('C',5);

1 row created.

SQL> insert into subtest values ('D','alpha');

1 row created.

SQL> commit;

Commit complete.

SQL>
SQL> select * from subtest;

F NUM
- ----------
A 3
C 5
D alpha

SQL> select flag,to_number(num) num from subtest
  2  where flag in ('A','C');

F        NUM
- ----------
A          3
C          5

SQL> select * from
  2  (
  3  select flag,to_number(num) num from subtest
  4  where flag in ('A','C')
  5  )
  6  where num > 0;

F        NUM
- ----------
A          3
C          5

     *** No Error Here. ***
     
SQL>
SQL>  select * from subtest where num > 0;
ERROR:
ORA-01722: invalid number

no rows selected

SQL> 

-- 
    mailto:pgro@xxxxxxxxx



*********************************************************************
This  e-mail  message,  and  any  files  transmitted  with  it, are
confidential  and intended  solely for the  use of the  addressee. If
this message was not addressed to  you, you have received it in error
and any  copying,  distribution  or  other use  of any part  of it is
strictly prohibited. Any views or opinions presented are solely those
of the sender and do not necessarily represent  those of the British
Geological  Survey. The  security of e-mail  communication  cannot be
guaranteed and the BGS accepts no liability  for claims arising as a
result of the use of this medium to  transmit messages from or to the
BGS. .                            http://www.bgs.ac.uk
*********************************************************************

----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: