Output parameters for the stored procedure is garbled to, "UseUnicode = True" in the Oracle direct connection

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
masakazu matsubara
Posts: 6
Joined: Sat 24 Aug 2013 15:42

Output parameters for the stored procedure is garbled to, "UseUnicode = True" in the Oracle direct connection

Post by masakazu matsubara » Sun 25 Aug 2013 01:22

Hello.

Output parameters for the stored procedure is garbled to, "UseUnicode = True" in the Oracle direct connection.

Is there a solution? .

Code: Select all

procedure TForm1.Button1Click(Sender: TObject);
var
  SP: TUniStoredProc;
  Connection: TUniConnection;
begin
  Connection := TUniConnection.Create(nil);
  Connection.ProviderName := TOracleUniProvider.GetProviderName;
  Connection.Server := 'localhost:1521:XE';
  Connection.SpecificOptions.Values['Direct'] := 'True';
  Connection.SpecificOptions.Values['UseUnicode'] := 'True';
  Connection.Username := 'shopping';
  Connection.Password := 'shopping';
  Connection.Connect;

  Connection.ExecSQL('begin DBMS_OUTPUT.ENABLE(); DBMS_OUTPUT.PUT_LINE(''あいうえおABCDE''); end;');	//	"あいうえお" is japanese text

  SP := TUniStoredProc.Create(nil);
  SP.Connection := Connection;
  SP.StoredProcName := 'DBMS_OUTPUT.GET_LINE';
  SP.ExecProc;
  ShowMessage(SP.Params.Items[0].AsString);
end;
Output message : ����������ABCDE


UniDAC 5.0.2
Delphi XE2
Oracle 11g Express Edition Release 11.2.0.2.0

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Output parameters for the stored procedure is garbled to, "UseUnicode = True" in the Oracle direct connection

Post by AlexP » Tue 27 Aug 2013 09:04

Hello,

To make such procedure work, you should set the OCIUnicode (declared in OraCallUni) to True

Code: Select all

uses ..., OraCall;

begin
  OCIUnicode := true;
  ....
  

masakazu matsubara
Posts: 6
Joined: Sat 24 Aug 2013 15:42

Re: Output parameters for the stored procedure is garbled to, "UseUnicode = True" in the Oracle direct connection

Post by masakazu matsubara » Wed 28 Aug 2013 00:19

Hello,

I was able to successfully solve the problem. :)

Thank you.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Output parameters for the stored procedure is garbled to, "UseUnicode = True" in the Oracle direct connection

Post by AlexP » Wed 28 Aug 2013 05:27

Hello,

Glad to see that the problem was solved. If you have any other questions, feel free to contact us.

Post Reply