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

Thread: Ora-06502

  1. #1
    Join Date
    Jan 2001
    Posts
    63

    Ora-06502

    Hi all,
    I have a PL/SQL procedure that reads data from a DB2 table across a database link using Oracle Gateway. The column occasionally causing me a problem is a CHAR(10) on the DB2 side. I am reading it and placing the data into an Oracle table where this column is defined as VARCHAR2(10).

    If the data in the DB2 CHAR(10) column is like '1880 E', I get the following error when running my proc:

    ORA-06502: PL/SQL: numeric or value error: character to number conversion error

    If I remove the 'E', it runs without error. Since this is just a CHAR to VARCHAR2 conversion, why should I get this error? I have tried to fix it by setting the field to TO_CHAR(DB2 field) on the update, but then I get this error:

    PLS-00307: too many declarations of 'TO_CHAR' match this call

    Any ideas?
    BTW, using Oracle 8.1.7.4

    Thanks.

  2. #2
    Join Date
    Jun 2002
    Posts
    6

    Thumbs up

    Can you please provide the part of the PL/SQL Code that is giving the error at the time of conversion from DB2 to Oracle. In general the "numeric or value error is given" when there is a data type mismatch.

    Please check the code that is responsible for extraction of the data from DB2 database. Somehow I feel its returning a numeric value.

    Regards
    Shan

  3. #3
    Join Date
    Jan 2001
    Posts
    63
    All,
    Never mind...I figured it out. The problem wasn't coming from where I thought it was in the UPDATE statement into the VARCHAR2, but from another place in the code where this character data really was trying to be put into a numeric column.

    Thanks,

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