Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 516929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:46:55+00:00 2026-05-13T07:46:55+00:00

Oracle 10g DB. I have a table called s_contact . This table has a

  • 0

Oracle 10g DB. I have a table called s_contact. This table has a field called person_uid. This person_uid field is a varchar2 but contains valid numbers for some rows and in-valid numbers for other rows. For instance, one row might have a person_uid of ‘2-lkjsdf’ and another might be 1234567890.

I want to return just the rows with valid numbers in person_uid. The SQL I am trying is…

select person_uid 
from s_contact 
where decode(trim(translate(person_uid, '1234567890', ' ')), null, 'n', 'c') = 'n'

The translate replaces all numbers with spaces so that a trim will result in null if the field only contained numbers. Then I use a decode statement to set a little code to filter on. n=number, c=char.

This seems to work when I run just a preview, but I get an ‘invalid number’ error when I add a filter of…

and person_uid = 100
-- or
and to_number(person_uid) = 100

I just don’t understand what is happening! It should be filtering out all the records that are invalid numbers and 100 is obviously a number…

Any ideas anyone? Greatly Appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T07:46:55+00:00Added an answer on May 13, 2026 at 7:46 am

    Another alternative is to combine the predicates:

    where case when translate(person_uid, '1234567890', ' ')) is null 
      then to_number(person_uid) end = 100
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

using a Oracle 10g db I have a table something like this: create table
I have a table in Oracle 10g that contains some information as follows: SQL>
I'm running Oracle 10g and have columns with Type_Name TIMESTAMP(6) WITH TIME ZONE When
In an Oracle 10g environment, I have a statement that needs to be executed
I've got an Oracle 10g database, and I have a third-party jar file. I
I'm using SQL*Plus 9.2 on Oracle 10g enterprise. I have created some scripts that
I have successfully connected to an Oracle database (10g) from C# (Visual Studio 2008)
I have a column called THE_VALUE in a table TABLE_A , that holds data
I have a situation where I have an Oracle procedure that is being called
I have this table: old_id integer NOT NULL, new_id integer Now I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.