pervasivepervasive-sql

Does Pervasive 13 Offer Triggers, or some similar Alternative?


Does Pervasive 13 offer any mechanism by which actions can be initiated each time a row is added to a particular table, and each time a row is modified in a particular table?

Other databases call these "triggers", and they're a crucial mechanism for event-driven development that avoids inefficient polling techniques.


Solution

  • As you've found, Triggers are available in Pervasive 13. But there is a caveat on triggers. If your application only uses the SQL interfaces (ODBC, OLEDB, JBC, PDAC - TPvSqlSession, TPvQuery, etc) then your application will be fine. If you use any Btrieve / transactional interface then your application may stop working correctly.

    Once a trigger is set on a Pervasive file, Btrieve access for that operation is disabled. For example if you create an Insert Trigger, then Btrieve Inserts will return a status 149 and the operation will fail. Same is true of Update and Delete triggers.