Subject RE: [firebird-support] Re: Anyone help me with a Delphi 7 & Firebird question?
Author Clay Shannon
<< I am not sure how FIBPlus works, there may well be a stored procedure
component.>>

Yes, FIB+ does have a stored procedure component. I use the same set of
tools (D7, FB 1.5, FIB+). I also use Database Workbench, which makes
creating the Stored Procedures a breeze.

Here's an example of the type of code I write to execute Stored Procedures:

procedure InsertScheduledWorkRecord(AEmpNo,
AShiftCode,
ACircumstanceCode: Integer;
AShiftDate: TDate;
AShiftBegin, AShiftEnd: TTime;
ASortOrder: SmallInt;
AFTEVal, AScheduler: String);
var
sp: TpFIBStoredProc;
trans: TpFIBTransaction;
begin
sp := TpFIBStoredProc.Create(nil);
try
trans := TpFIBTransaction.Create(nil);
try
sp.Database := fSchedulerMain.FIBDB;
sp.Transaction := trans;
trans.DefaultDatabase := fSchedulerMain.FIBDB;
trans.Active := True;
sp.StoredProcName := 'P_INSERT_SCHEDULED_WORK_CBRF';
sp.ParamByName('EMPNO').AsInteger := AEmpNo;
sp.ParamByName('SHIFTDATE').AsDate := AShiftDate;
sp.ParamByName('SHIFTCODE').AsInteger := AShiftCode;
sp.ParamByName('CIRCUMSTANCECODE').AsInteger := ACircumstanceCode;
sp.ParamByName('SORT_ORDER').AsInteger := ASortOrder;
sp.ParamByName('FTE_VAL').AsFloat := StrToFloat(AFTEVal);
sp.ParamByName('SHIFT_BEGIN').AsTime := AShiftBegin;
sp.ParamByName('SHIFT_END').AsTime := AShiftEnd;
sp.ParamByName('SCHEDULER').AsString := AScheduler;
try
sp.ExecProc;
trans.Commit;
except
on e: Exception do begin
InsertExceptionDataEx(Application.ExeName,
Application.Title,
e.ClassName,
e.Message,
SysErrorMessage(GetLastError),
GetLastError,
GetMachineName,
TPFIBDatabase(sp.Database));
trans.Rollback;
end;
end;
finally
trans.Free;
end;
finally
sp.Free;
end;
end;

Clay Shannon,
Dimension 4 Software