Create SQL triggers to override WebSphere Commerce database table triggers

If you need to override the SQL database table triggers provided for WebSphere Commerce database tables, we can create our own custom triggers to override the default triggers.


Task info

To create our own SQL triggers for provided WebSphere Commerce database tables, we must drop the existing database triggers and then create your triggers. The SQL to drop and create the triggers for the database tables must be added to the following files:

Where dbtype is db2.

These files contain the SQL triggers for the database tables provided with WebSphere Commerce. The stagingcopy utility and the stagingprop utility can run these files to drop and create or re-create triggers. Attention: Any custom triggers created for database tables provided with WebSphere Commerce can be overwritten when you apply maintenance fixes or upgrade WebSphere Commerce


Procedure

  1. Open the Utility server Docker container.

  2. Go to the directory that includes the SQL database triggers for the tables provided with WebSphere Commerce If we are creating custom triggers for a database table that is provided with WebSphere Commerce, go to the following directory:

  3. Open the SQL trigger files to update for editing. Update the SQL to define our custom database triggers.

  4. (DB2) As an administrator with access to the database, manually run the corresponding drop trigger file.

  5. Manually run the staging trigger script to create or re-create the database table triggers to use our custom triggers.


Related tasks
Filtering data for the stagingprop utility to propagate


Related reference
stagingprop utility