i have an oracle stored procedure with 2 parameters declarated as input
cursors.
how i can assign this parameters using the TADOStoredProc component?
when try to assign the TADODataSet to the parameter can't compile the code because the ide gives me this error.
incompatible types : OleVariant and TAdoDataset.
ORACLE
PROCEDURE MYSTOREDPROCEDURE(P_HEADER IN TCursor, P_DETAL IN TCursor, P_RESULT OUT VARCHAR2)
BEGIN
//My code goes here
END;
Delphi
function TMyClass.Add(Header, Detail: TADODataSet;var _Result: string): boolean;
Var
StoredProc : TADOStoredProc;
begin
Result:=False;
StoredProc:=TADOStoredProc.Create(nil);
try
StoredProc.Connection :=ADOConnection1;
StoredProc.ProcedureName:='MYSTOREDPROCEDURE';
StoredProc.Parameters.Refresh;
StoredProc.Parameters.ParamByName('P_HEADER').Value :=Header;//How can assign this parameter?
try
StoredProc.Open;
_Result:=VarToStrNull(StoredProc.Parameters.ParamByName('P_RESULT').Value);
StoredProc.Close;
Result:=True;
except on E : Exception do
begin
_Result:=E.Message;
//exit;
end;
end;
finally
StoredProc.Free;
end;
end;
UPDATE
i tried this option too, without luck.
StoredProc.Parameters.CreateParameter('P_HEADER',ftCursor,pdInput,1,Header);