Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Unable to get out parameter value from Oracle 19c where getting error as
ORA-06502 : PL/SQL: Numeric or Value error : Character string buffer too small


What I have tried:

I have developed on POC where I have DB as oracle 19c and .Net application on framework version 4.5.2, In which Im trying to send one out parameter to database of type Varchar2, also in SP I have assigned value to Out parameter and when Im looking for value of out parameter getting error as "ORA-06502 : PL/SQL: Numeric or Value error : Character string buffer too small" where I have assigned values which are compatible of to varchar2.
If I try to run SP on oracle editor its working fine giving proper out but only in when its being called from .Net code getting failed.
We have used Oracle.DataAccess dll of 64 bit to perform ODP.Net operation.
Posted
Updated 17-Nov-21 23:02pm
Comments
Richard Deeming 18-Nov-21 4:11am    
There's a secret error somewhere in your secret code. You need to fix that.

Seriously, how do you expect anyone to help you fix an error in code we cannot see running against a database we cannot access?

Click the green "Improve question" link and update your question to include the relevant parts of your code and database structure, and some sample data.

1 solution

If you get an error message you don;t understand, google it: ORA-06502 : PL/SQL: Numeric or Value error : Character string buffer too small - Google Search[^]
The second link explains what causes the problem, and it's pretty obvious: ORA-06502: PL/SQL: numeric or value error: character string buffer too small – Yawin Tutor[^]
The string you are trying to load into the output parameter is too long to fit in the number of characters you have defined it to be. So your variable is declared as VARCHAR2[50] for example, and you are trying to put 51 characters in it.

We can't fix that for you: it's a function of code we can't see, combined with data we have no access to, and you probably need both to begin working out a suitable length. So start by copying your procedure and return a length instead of the string itself. That should help you track down the beginnings of the problem.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900