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
BTW, using Oracle 18.104.22.168
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.
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.
Click Here to Expand Forum to Full Width