Parameter getting truncated when being passed into procedure call.
-
- Posts: 51
- Joined: Mon 28 Aug 2006 11:07
Parameter getting truncated when being passed into procedure call.
I'm passing a long parameter (2500 characters in my example) and it gets truncated to 2002 characters when i am running with Unicode=true. However it works fine when Unicode=False. This is using version 3.55.21 of the component.
Here is the package definition im using (just a simple example that returns the lengh of the parameter passed in)
CREATE OR REPLACE PACKAGE BODY PKG_app_test AS
procedure proc_test3(
v_value IN varchar2,
v_result OUT number)
as
begin
select length(v_value) into v_result from dual;
end proc_test3;
END PKG_app_test;
and the C# code im calling it with..
private void button6_Click(object sender, EventArgs e)
{
String ParamValue = "";
OracleConnection oc = new OracleConnection();
oc.ConnectionString = "pooling = false";
oc.Unicode = true;
oc.AutoCommit = true;
oc.Server = "development";
oc.UserId = "schema";
oc.Password = "schema";
oc.Open();
OracleCommand o2 = oc.CreateCommand();
o2.ParameterCheck = true;
o2.CommandType = CommandType.StoredProcedure;
o2.CommandText = "pkg_app_test.proc_test3";
o2.Prepare();
ParamValue = ParamValue.PadLeft(2500, 'A');
o2.Parameters["v_value"].Value = ParamValue;
o2.ExecuteNonQuery();
MessageBox.Show(o2.Parameters["v_result"].Value.ToString());
}
All pretty simple stuff, I hope this allows you to recreate the problem.
Thanks
Darren
Here is the package definition im using (just a simple example that returns the lengh of the parameter passed in)
CREATE OR REPLACE PACKAGE BODY PKG_app_test AS
procedure proc_test3(
v_value IN varchar2,
v_result OUT number)
as
begin
select length(v_value) into v_result from dual;
end proc_test3;
END PKG_app_test;
and the C# code im calling it with..
private void button6_Click(object sender, EventArgs e)
{
String ParamValue = "";
OracleConnection oc = new OracleConnection();
oc.ConnectionString = "pooling = false";
oc.Unicode = true;
oc.AutoCommit = true;
oc.Server = "development";
oc.UserId = "schema";
oc.Password = "schema";
oc.Open();
OracleCommand o2 = oc.CreateCommand();
o2.ParameterCheck = true;
o2.CommandType = CommandType.StoredProcedure;
o2.CommandText = "pkg_app_test.proc_test3";
o2.Prepare();
ParamValue = ParamValue.PadLeft(2500, 'A');
o2.Parameters["v_value"].Value = ParamValue;
o2.ExecuteNonQuery();
MessageBox.Show(o2.Parameters["v_result"].Value.ToString());
}
All pretty simple stuff, I hope this allows you to recreate the problem.
Thanks
Darren
-
- Posts: 51
- Joined: Mon 28 Aug 2006 11:07
-
- Posts: 51
- Joined: Mon 28 Aug 2006 11:07
-
- Posts: 51
- Joined: Mon 28 Aug 2006 11:07
-
- Posts: 51
- Joined: Mon 28 Aug 2006 11:07