There are distinct database triggers available which fire on the create and write events on a database table. You can define them in the data dictionary tool so that they are part of the database schema or you can define them in a procedure. Defining them in the database scheme makes sure that they are always fire ( only 4GL not SQL clients ) whereas defining them in the session they will only fire for that particular 4GL session.
But you need to aware, regardless where you define them they are always executed by the client and not by the database engine. Plus the create trigger immediately fires after the create event has taken place ( which allows you to populate for example the unique record identifier automatically ) and the write trigger fires at the end of the buffer scope or transaction scope, whichever comes first. This is important to know when you need to catch an error from a database trigger.
Heavy Regards, RealHeavyDude.