Home page  
Help >
ddlSetTriggerCb() - Create a Trigger
Version 7.11
ddlSetTriggerCb() - Create a Trigger
ddlSetTriggerCb() - Create a Trigger
   void ddlSetTriggerCb(
      CONTROL *ctl,
      WtChar8 *OptnStr,
      WtChar8 *ArgStr,
      TriggerRtn UserTrigger,
      WtCastPtr UserWord,
      WtInt32 triggerID);
 
      Format of ArgStr:
         <trigger-type> <trigger-type-modifier> <target-type> <target-name>
 
         <trigger-type> - {INSERT | UPDATE | DELETE}
         <trigger-type-modifier> - {BEFORE | INSTEAD | AFTER}
         <target-type> <target-name>
            TABLE  [<table-name>]
            COLUMN <column-name>
            INDEX  <index-name>
            VIEW   <view-name>
 
   typedef int (STDCALL *TriggerRtn)(
      WtCastPtr UserWord,
      WtInt32 triggerID,
      WtInt32 RelRecNo,         /* 1-rel TB recno per table */
      WtLong64 timestamp,
      WtChar8 *targetName,
      WtInt32 valueSize,
      WtChar8 *valueOld,
      WtChar8 *valueNew);
 
      targetName is a function of <target-type>
 
      the format of valueOld and valueNew also is a function
      of <target-type>:
 
         <target-type>   format
         -------------   ------
         TABLE           full record according to DBD schema (non-virtual columns only)
         COLUMN          column only according to DBD schema
         INDEX           column only according to DBD schema
         VIEW            full record according to DBD schema (non-virtual columns only)
 
         the presence of valueOld and valueNew is a function of
         <trigger-type> and <trigger-type-modifier>
 
            <trigger-type>  <trigger-type-modifier>  valueOld   valueNew
            --------------  -----------------------  --------   --------
               INSERT            BEFORE                NULL       value
               INSERT            INSTEAD               NULL       value
               INSERT            AFTER                 NULL       value

               UPDATE            BEFORE                value      value
               UPDATE            INSTEAD               value      value
               UPDATE            AFTER                 value      value

               DELETE            BEFORE                value      NULL
               DELETE            INSTEAD               value      NULL
               DELETE            AFTER                 value      NULL
Permitted values in OptnStr: NA

Description:

Also See:
       ddlDestroyTrigger()

Copyright © 2019 , WhamTech, Inc.  All rights reserved. This document is provided for information purposes only and the contents hereof are subject to change without notice. Names may be trademarks of their respective owners.