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

  • SEARCH
  • Home
  • 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 7693607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:07:43+00:00 2026-05-31T21:07:43+00:00

I found this odd behavior and I’m breaking my brains with this… anyone has

  • 0

I found this odd behavior and I’m breaking my brains with this… anyone has any ideas?

Oracle 10g:
I have two different tables, both have this column named “TESTCOL” as Varchar2(10), not nullable.

If I perform this query on table1, i get the proper results:

select * from table1 where TESTCOL = 1234;

Note that I’m specifically not placing ‘1234’… it’s not a typo, that’s a dynamic generated query and I will try not to change it (at least not in the near future).

But, if I run the same query, on table2, I get this error message:

ORA-01722: Invalid number

Both queries are run on the same session, same database.

I’ve been joining these two tables by that column and the join works ok, the only problem shows whenever I try to use that condition.

Any ideas on what could be different from one table to the other?

Thanks in advance.

  • 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-31T21:07:44+00:00Added an answer on May 31, 2026 at 9:07 pm

    If TESTCOL contains non-numbers, then Oracle might run into problems when converting TESTCOL entries to numbers. Because, what it does internally, is this:

    select * from table1 where TO_NUMBER(TESTCOL) = 1234;
    

    If you’re so sure that 1234 cannot be expressed as a VARCHAR literal, then try this instead, in order to compare varchar values, rather than numeric ones:

    select * from table1 where TESTCOL = TO_CHAR(1234);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Graphael doesn't have an unhover event for some odd reason. Found this chunk of
I just found an odd behavior within our application. We have a rich:tabPanel switchType=ajax
I have found some odd behaviour while I was using the PHP function in_array()
An odd question this will be, but here goes. I have a page on
hopefully someone can help me with this odd problem. I have a database which
This may be a bit of an odd question, and what I have in
I've found this odd case of some code (below) doesn't compile under Visual Studio
I found this little gem in our codebase at work recently. I have to
Found this: Sub SurroundWithAppendTag() DTE.ActiveDocument.Selection.Text = .Append( + DTE.ActiveDocument.Selection.Text + ) End Sub But
found this regex: insert every 10 characters: $text = preg_replace(|(.{10})|u, \${1}. , $text); can

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.