Page 1 of 1

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

Posted: Sun 25 Aug 2013 01:22
by masakazu matsubara
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

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

Posted: Tue 27 Aug 2013 09:04
by AlexP
Hello,

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

Code: Select all

uses ..., OraCall;

begin
  OCIUnicode := true;
  ....
  

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

Posted: Wed 28 Aug 2013 00:19
by masakazu matsubara
Hello,

I was able to successfully solve the problem. :)

Thank you.

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

Posted: Wed 28 Aug 2013 05:27
by AlexP
Hello,

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