Thursday, March 8, 2018

DELPHI - How to call (old) BDE stored procedure

Note: orcl is TDatabase with connection.
var
  pStoredProc : TStoredProc;
begin
  try

    pStoredProc := TStoredProc.Create( Application );
    pStoredProc.DatabaseName := orcl.DataBaseName;

    { -- call stored procedure }

    pStoredProc.StoredProcName := AnsiUpperCase(  'factory.an_p1.Sql_Standard_DeleteDay' );
    pStoredProc.Prepare;
    pStoredProc.Params.ParamByName( 'pPeriod' ).AsString := _sPeriod;
    pStoredProc.ExecProc;

  finally
    pStoredProc.Free;
  end;

No comments:

Post a Comment