Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

to_number giving invalid number, I don't understand why...

643412Dec 18 2012 — edited Dec 18 2012
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for Solaris: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production


I'm trying to run the following, and it's giving me invalid number...And I don't understand why.
Syntax
The syntax for the to_number function is:

to_number( string1, [ format_mask ], [ nls_language ] )

string1 is the string that will be converted to a number.

format_mask is optional. This is the format that will be used to convert string1 to a number.

nls_language is optional. This is the nls language used to convert string1 to a number. >

My sql:
select to_number('pnvg') as BPS_ID_FK,
        substr('A_OVRSTRY_AVG_DBH_LOW', 0,1) as SERAL, 
        substr('A_OVRSTRY_AVG_DBH_LOW', 3) as KEY_NAME,
        A_OVRSTRY_AVG_DBH_LOW as KEY_VALUE        
from FS_NRIS_INFORMS.NRI_FRCC_REF
From what I can see, I've followed the same rule as the examples I've looked up. I don't get it.

Thanks!l
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 15 2013
Added on Dec 18 2012
6 comments
429 views