11.3.2 variant and string problem
Posted: Wed 28 Oct 2020 18:51
Hello,
Today I tried the Odac 11.3.2 components, and I ran into a problem.
Previously, we used Odac 11.2.5
With Odac 11.2.5 (and every version before), when a stored function returned a null value, I was able to read it's result directly into a string variable without problems.
Numeric results did not worked before, I know, but I had no problem with strings.
Now, when I execute this procedure, I get variant error.
This is the oracle function (of course, the empty string is a null value in oracle)
create or replace function doNothing return varchar2 is
begin
return '';
end;
/
When I call this function from Delphi, I get this error message.
var
s:string;
begin
s:=DefSession.ExecProcEx('donothing',[]);
end;
---------------------------
Debugger Exception Notification
---------------------------
Project odatesz.exe raised exception class EVariantTypeCastError with message 'Could not convert variant of type (Null) into type (OleStr)'.
Of course, if I read the parameter value, it works, but please, we used the Execproc method thousands of times with this call, wihtout problems.
var
s:string;
begin
DefSession.ExecProcEx('donothing',[]);
s:=DefSession.ParamByName('result').asString;
end;
Today I tried the Odac 11.3.2 components, and I ran into a problem.
Previously, we used Odac 11.2.5
With Odac 11.2.5 (and every version before), when a stored function returned a null value, I was able to read it's result directly into a string variable without problems.
Numeric results did not worked before, I know, but I had no problem with strings.
Now, when I execute this procedure, I get variant error.
This is the oracle function (of course, the empty string is a null value in oracle)
create or replace function doNothing return varchar2 is
begin
return '';
end;
/
When I call this function from Delphi, I get this error message.
var
s:string;
begin
s:=DefSession.ExecProcEx('donothing',[]);
end;
---------------------------
Debugger Exception Notification
---------------------------
Project odatesz.exe raised exception class EVariantTypeCastError with message 'Could not convert variant of type (Null) into type (OleStr)'.
Of course, if I read the parameter value, it works, but please, we used the Execproc method thousands of times with this call, wihtout problems.
var
s:string;
begin
DefSession.ExecProcEx('donothing',[]);
s:=DefSession.ParamByName('result').asString;
end;