Problem with parameters when using packages and unicode = true

Problem with parameters when using packages and unicode = true

Postby DarrenColes » Tue 17 Apr 2007 14:56

My problem is that it seems as if the parameters are getting corrupted with extra characters when i am using unicode = true.

Create the following package and table

CREATE OR REPLACE PACKAGE PKG_PARAM_TEST IS

procedure proc_test(
v_name IN varchar2,
v_category IN varchar2,
v_query OUT varchar2,
v_description OUT varchar2);

procedure proc_test2(
v_name IN varchar2,
v_category IN varchar2);

END PKG_PARAM_TEST
;

CREATE OR REPLACE PACKAGE BODY PKG_PARAM_TEST AS

procedure proc_test(
v_name IN varchar2,
v_category IN varchar2,
v_query OUT varchar2,
v_description OUT varchar2)
as
begin
insert into logs logtext values (v_category);
end proc_test;

procedure proc_test2(
v_name IN varchar2,
v_category IN varchar2)
as
begin
insert into logs logtext values (v_category);
end proc_test2;

END PKG_PARAM_TEST;

create table LOGS
(
LOGTEXT VARCHAR2(4000)
);

then when using this code:

private void button4_Click(object sender, EventArgs e)
{
OracleConnection oc = new OracleConnection();
oc.Unicode = true;
oc.Server = "development";
oc.UserId = "main";
oc.Password = "main";
oc.Open();

OracleCommand o = new OracleCommand();
o.Connection = oc;
o.ParameterCheck = true;
o.CommandType = CommandType.StoredProcedure;
o.CommandText = "pkg_param_test.proc_test";
o.Prepare();

o.Parameters["v_name"].Value = "1111";
o.Parameters["v_category"].Value = "2222";
o.ExecuteNonQuery();
MessageBox.Show("completed ok");

}

i get 5 characters inserted into the table, where the last character is unprintable.

if i call pkg_param_test.proc_test2 which differs only in its parameters, it works fine. It also works fine when unicode = false.

This is using OraDirect 3.55.17.0 with direct = false and Oracle 9i 9.2.0.8.0 and our database is configured to use the UTF8 character set.

Any help would be most appreciated.
DarrenColes
 
Posts: 47
Joined: Mon 28 Aug 2006 11:07

Postby Alexey » Wed 18 Apr 2007 07:06

Unfortunately, we cannot reproduce this problem. Try to use the latest version of OraDirect .NET.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby DarrenColes » Thu 19 Apr 2007 09:28

Yep that seems to have solved the issue for me.

Thanks

Darren
DarrenColes
 
Posts: 47
Joined: Mon 28 Aug 2006 11:07

Postby Alexey » Thu 19 Apr 2007 09:37

Not at all.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43


Return to dotConnect for Oracle