• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Invalid Number when converting the string value into Number

 
Ranch Hand
Posts: 35
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I have data as described below.

ward -string column
User_id - Id column

Ward --> User_ID
------------ -------------

9435167847467 --> 1041358
9435167847467 --> 1041359
009999441 --> 1041439
rtrt090909 --> 1002122
rrrrrrrrrrrr --> 1548722

Need to get the data from ward column where the data has only numeric value and then the value should be greater then 9999450.
so i need to get only 1) & 2) row .But it shows me invalid number.

I used the below query
----------------------------

select ward,user_id from (

SELECT
to_number(ward) as ward,
USER_ID
FROM NEW_USER
WHERE (REGEXP_LIKE(WARD,'^[[:digit:]]+$') AND LENGTH(WARD)>=8))
where ward>9999450;

can you let me know where the issue is?

 
sudhir pavan
Ranch Hand
Posts: 35
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
got the result when applied to_number function to where clause also.
 
author & internet detective
Posts: 42148
937
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sudhir pavan wrote:got the result when applied to_number function to where clause also.


Good. Thanks for posting that you found the answer. It will help future readers with the same question.
 
reply
    Bookmark Topic Watch Topic
  • New Topic