Update or insert

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
calou
Posts: 116
Joined: Tue 27 May 2008 12:46

Update or insert

Post by calou » Fri 07 Aug 2015 10:33

Hello,

when we use update or insert with IBCQuery, would it be possible to know if it is an insert or an update which has occurred in the database?

Thanks for help

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Update or insert

Post by ViktorV » Tue 11 Aug 2015 10:50

To determine whether a record was inserted or updated at execution of an UPDATE OR INSERT statement, you can use the TIBCQuery.RowsInserted or TIBCQuery.RowsUpdated events. See more details in the IBDAC help: https://www.devart.com/ibdac/docs/?deva ... serted.htm and https://www.devart.com/ibdac/docs/?deva ... pdated.htm
Firebird has an event handling mechanism that allows to generate messages on the server side (e.g. about database modifying) and send them to client applications. More details about Firebird events: http://www.firebirdsql.org/file/documen ... events.pdf
Using IBDAC, you can organize event handling in an application with the TIBCAlerter component. Learn more at https://www.devart.com/ibdac/docs/?deva ... lerter.htm You can also see find the IbDacDemo project, in which event handling is implemented, in the 'Demos\IbDacDemo' folder relatively to the IBDAC demos installation path.

Post Reply