Creating SQL triggers to override WebSphere Commerce database table triggers
If you need to override the SQL database table triggers that are provided for
WebSphere Commerce database tables, you can create your own custom triggers to override the
default triggers.
About this task
To create your own SQL triggers for provided WebSphere Commerce database tables, you
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:
- WC_installdir/schema/dbtype/wcs.stage.trigger.sql
- WC_installdir/schema/dbtype/wcs.droptrigger.sql
- WC_installdir\schema\dbtype\wcs.stage.trigger.sql
- WC_installdir\schema\dbtype\wcs.droptrigger.sql
These files contain the SQL triggers for the database tables that are 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 that you create for database tables that are provided with
WebSphere Commerce can be overwritten when you apply maintenance fixes or upgrade WebSphere Commerce
Procedure
-
Go to the directory that includes the SQL database triggers for the tables that are provided
with WebSphere Commerce
If you are creating custom triggers for a database table that is provided with WebSphere Commerce, go to the following directory:
- WC_installdir/schema/dbtype
- WC_installdir\schema\dbtype
- Open the SQL trigger files that you want to update for editing. Update the SQL to define your custom database triggers.
- As an administrator with access to your database, manually run the corresponding drop trigger file. For Oracle databases, you do not need to drop the trigger before you create a new trigger.
- Manually run the staging trigger script to create or re-create the database table triggers to use your custom triggers.