Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2002
    Posts
    227

    Unanswered: ora-01722:invalid number

    hi,
    I get this query:
    select col
    from tab
    where col > 6
    group by col

    when I get on instance x it run correctly, but when I get on instance y I get error ora-01722.
    datatype of col is varchar2(32)


    Raf

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: ora-01722:invalid number

    Originally posted by raf
    hi,
    I get this query:
    select col
    from tab
    where col > 6
    group by col

    when I get on instance x it run correctly, but when I get on instance y I get error ora-01722.
    datatype of col is varchar2(32)


    Raf
    If col is a VARCHAR2 then you should not be comparing it to a NUMBER!
    What is happening is that Oracle is casting col to NUMBER to do the comparison (i.e. doing TO_NUMBER(col)). In instance x there are no values in col that cannot be cast to NUMBER, but in instance y there are.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •