to_number question 2004-07-14 - By Stephen.Lee@(protected)
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
======= AND NOW =======
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 (See ORA-01722.ora-code.com): invalid number
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To unsubscribe send email to: oracle-l-request@(protected)
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
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
|
|