Firebird : Stored proc on insert/update

In this forum we will discuss things relating the ZEOSLib 6.6.x stable versions

Moderators: gto, EgonHugeist

Post Reply
Darkbow
Fresh Boarder
Fresh Boarder
Posts: 19
Joined: 01.09.2009, 12:28

Firebird : Stored proc on insert/update

Post by Darkbow »

Hi,

using scenario Lazarus 0.9.31-29128 + FPC-2.4.2-20110120 + Firebird Embedded 2.1 in a Win32 environment I have following scenario:
  • TZQuery which retrieves a select that is a join of three tables.
  • I have an editable DBGrid tied to this TZQuery through a TDataSource.
  • Whenever the user inserts or updates a register, I need to call a stored procedure to perform some comprobations and do the appropiate operation at database level.
  • Using plain SQL commands in a TZUpdateSQL is not possible because I need to check for some conditions.
At work I use the ODAC components (for Oracle) which have an InsertSQL and an UpdateSQL property (similar to the TZUpdateSQL ones). To call a stored procedure I just put following into those properties:

Code: Select all

Begin
  MyStoredProc(:param1, ...);
End;
I would like to do something similar with Zeos + Firebird. Is it possible to do this with a TZUpdateSQL (tried but no luck so far)? Or will I need to program the AfterPost event of my TZQuery to call the procedure through a TZStoredProc?

Thanks in advance for any input and best regards. :)
Post Reply