What is the proper way to dynamically create and call a stored procedure in Delphi using FireDac?
问题 I am relatively new to FireDAC. I want to be able to call a stored procedure "on the fly", dynamically. So far I have the following: function TForm21.ExecuteStoredProc(aSPName: string; aParams: TADParams): Boolean; var LSP: TADStoredProc; i: Integer; begin LSP := TADStoredProc.Create(nil); try LSP.Connection := ADConnection1; LSP.StoredProcName := aSPName; LSP.Prepare; for i := 0 to aParams.Count - 1 do begin LSP.Params[i].Value := aParams[i].Value; end; LSP.ExecProc; finally LSP.Free; end;