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: to_number question

RE: to_number question

From: <Stephen.Lee_at_DTAG.Com>
Date: Wed, 14 Jul 2004 20:17:31 -0500
Message-ID: <D6339830FC73944E889CC3CEADDB205B07909517@bu-dtagpo1.tracs.com>

Well now I'm not so sure about the previous post I did. Observe! (The reason for the subquery is that I have been screwing around with what was in it.)

select distinct nbr_cc_fop_name, X, Y

   from (
   select nbr_cc_fop_name, to_number(trim(nbr_cc_no_high)) X , to_number(trim(nbr_cc_no_low)) Y

   from nbr_cc
   where nbr_cc_fop_name in ('AX','MC','VI','DS')
)

NBR_CC                   X                   Y
------ ------------------- -------------------
AX         349999999999999     340000000000000
AX         379999999999999     370000000000000
DS        6011999999999999    6011000000000000
MC        5590999999999999    5000000000000000
MC        5999999999999999    5592000000000000
VI           4999999999999       4000000000000
VI        4999999999999999    4000000000000000

select distinct nbr_cc_fop_name, X, Y

   from (
   select nbr_cc_fop_name, to_number(trim(nbr_cc_no_high)) X , to_number(trim(nbr_cc_no_low)) Y

   from nbr_cc
   where nbr_cc_fop_name in ('AX','MC','VI','DS')
)

where X - Y > 0 <<----- SCREWS IT UP

        select nbr_cc_fop_name, to_number(trim(nbr_cc_no_high)) X , to_number(trim(nbr_cc_no_low)) Y

                                          *
ERROR at line 3:
ORA-01722: invalid number

Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Wed Jul 14 2004 - 20:14:31 CDT

Original text of this message

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