Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

'ORA-06502 character string buffer too small' when called from C# app

403793Apr 26 2007 — edited Apr 26 2007
I have researched this problem and checked my variable sizes over and over again. I have tested the procedure within the Oracle Express environment and it works fine; HOWEVER, when the procedure is called from my C# app it produces the ORA-06502 error.

The stored procedure signature looks like this...
create or replace save_new_project (p_custorgid in number,
  p_title in varchar2,
  p_AOIName in varchar2,
  p_description in varchar2,
  p_receiveddate in date,
  p_deadlinedate in date,
  p_startdate in date,
  p_createddate in date,
  p_createdby in varchar2,
  p_projectid out number,
  p_statustypedescrip out varchar2)
The OracleParameter in my C# app for the last out param is defined as such...
cmd.Parameters.Add(new OracleParameter("p_statustypedescrip", OracleDbType.Varchar2, 30, ParameterDirection.Output));
As I said at the beginning of this post, the procedure works fine in the Oracle environment. So why is it not working by simply calling it from C#? I've tried changing the OracleDbType to CLOB which eliminates the error but it returns a bizarre result. It returns this string, "Oracle.DataAccess.Types.OracleClob". WTH?!!

Since CLOB doesn't really work either I switch back to Varchar2 and specify a size of 5000 (in the database the field I am querying is defined as Varchar(30)). I still get the ORA-06502 error.

I am clueless as to what the problem is. It should work and it does if I run a series of SQL statements in an Oracle SQL Command window. The test that works fine looks like this...
declare
  v_projid projects.projectid%type;
  v_statustypedescrip projectstatustypes.type%type;   /* this is a varchar(30) */
begin
  save_new_project(2, 'Some input text goes here', 'More input text', 'And more again','26-APR-2007','26-APR-2007','26-APR-2007','26-APR-2007','users name as inpujt text here',v_projid,v_statustypedescrip);
  dbms_output.put_line('v_projid = ' || v_projid);
  dbms_output.put_line('v_statustypedescrip = ' || v_statustypedescrip);
end;
But calling save_new_project from C# throws ORA-06502. It identifies line 40 of my stored procedure. This is line 40...
p_statustypedescrip := v_statustypedescrip;
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 24 2007
Added on Apr 26 2007
3 comments
1,544 views