I am encountering a problem with Unidac about Stored Proc,
We had in my company on our soft previously SDAC and ODAC, and we mooved on UNIDAC recently
We add and ajust Unicomponents.
With MS SQL it was possible to make the stored proc return a scalar value , used in the code with Proc.ReturnValueName and it was doable with SDAC.
Most of the existing code seems to work with Unidac but i get an erorr when i run the project :
This is where i run the storedproc :EDatabaseError Exception, Invalid parameter type
Code: Select all
begin
zProc := LpDefaultConnection.CreateStoredProc(Application);
try
zProc.StoredProcName := 'sp_nextval';
zProc.ReturnParams := True;
if zProc.Params.Count = 0 then
begin
zProc.Params.CreateParam(ftString, 'Ky', ptInput);
zProc.Params.CreateParam(ftInteger, zProc.ReturnValueName, ptResult);
end;
zProc.ParamByName('Ky').AsString := zKyCpteur;
zProc.ExecProc;
zValeurChaine := zProc.ParamByName(zProc.ReturnValueName).AsString;
zOk := zProc. not EstVide(zValeurChaine);
finally
zProc := nil;
end;
However i did this :
Code: Select all
TUniStoredProc(DataSet).Options.ReturnParams := True;
I don't know if it's a functionnality who is not on Unidac or if i missed something
Thank you in advance