Oracle Package Wizard and Unicode
Posted: Sun 21 Feb 2010 23:31
In a package, I have this function:
The "Oracle Package Wizard" produces this wrapper:
When I call:
Then on return, Res contains garbage (i.e. '???????? ???????') rather than the russian characters. Both OraSession.Options.UseUnicode and OCIUnicode are True.
Now, if I do the same with a TOraStoredProc, all works as expected. So, what is wrong with the auto generated wrapper?
Using registered version of ODAC 6.90.0.55 with Delphi 2009.
Thanks, Lu
Code: Select all
Function Test(Divisor In Integer,
SomeText In Nvarchar2) return Nvarchar2
As
RetVal Nvarchar2(100);
Begin
RetVal := SomeText;
Return RetVal;
End;Code: Select all
function TFdsSo.Test(const Divisor: double; const Sometext: WideString): WideString;
var
ResultParam, DivisorParam, SometextParam: TOraParam;
begin
BeginExecPLSQL;
try
ResultParam := AddParam('RESULT', ftWideString, ptOutput);
DivisorParam := AddParam('DIVISOR', ftFloat, ptInput);
DivisorParam.AsFloat := Divisor;
SometextParam := AddParam('SOMETEXT', ftWideString, ptInput);
SometextParam.AsWideString := Sometext;
ExecProc('TEST');
Result := ResultParam.AsWideString;
finally
EndExecPLSQL;
end;
end;Code: Select all
Var Res : WideString; // or String, doesn't matter
Res := Test(1,'Создание пиктограммы');Now, if I do the same with a TOraStoredProc, all works as expected. So, what is wrong with the auto generated wrapper?
Using registered version of ODAC 6.90.0.55 with Delphi 2009.
Thanks, Lu