DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: What could be different ?

  1. #1
    Join Date
    Feb 2000
    Location
    phoenix, AZ,USA
    Posts
    20

    Question What could be the cause?

    Hello,


    I am trying to execute the SQL statement

    SQL > select * from mytable where col1 = 1234438;

    col1 is varchar2(20).

    The query works and retreives the records on the development environment; whereas it gives an error ORA 1722 - invalid number in the test environment. It works fine if the value is enclosed in quotes.

    I would like to know what could be different between the two environments?

    Any input on this is greatly appreciated.

    Thanks in advance.


    I am able to perform the query on other varchar2 columns; it is failing only on this column.

    - Thanks

    [Edited by hedyash on 01-26-2001 at 03:03 PM]

  2. #2
    Join Date
    Oct 2000
    Posts
    123

    Re: What could be the cause?

    I clearly rember this issue be posted early in this forum, but I don't quite get hold of the date. You can try to find them in the former last two months threads.

    Thanks

  3. #3
    Join Date
    Jul 2000
    Posts
    296
    The difference is probably in the values of col1.
    You try to compare a NUMBER with a VARCHAR2. You don't explicitly convert the literal number (1234438) to character. In this case Oracle converts the varchar2 database column (col1) to number. If one of the values in col1 is not numeric, you get this error.
    Another problem with this implicit conversion is that indexes cannot be used in the query.

  4. #4
    Join Date
    Feb 2000
    Location
    phoenix, AZ,USA
    Posts
    20
    Thanks Akkerend. One of the values was a character string.


Posting Permissions

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


Click Here to Expand Forum to Full Width