Creating a View Trigger

Create a new trigger on a view in the system store.

Prerequisites
Database Version View Trigger Privileges
SAP Sybase IQ 15.3 and 15.4 You must have one of:
  • DBA authority
  • RESOURCE authority and you own the underlying view of the trigger
SAP Sybase IQ 16.0 You must have one of:
  • CREATE ANY TRIGGER system privilege
  • CREATE ANY OBJECT system privilege
You must also have one of:
  • ALTER ANY OBJECT system privilege
  • ALTER ANY VIEW system privilege
  • You own the underlying view of the trigger
Task
  1. In the Perspective Resources view, select the resource, and select Resource > Administration Console.
  2. In the left pane, expand IQ Servers > Schema Objects > Views, and then select Views.
  3. Select a view from the right pane on which to create the trigger and either:
    • Click the arrow to the right of the name and select Properties, or
    • From the Administration Console menu bar, select Resource > Properties.
    The Views Properties view appears.
  4. In the left pane, select Triggers.
  5. In the right pane, click New.
    The Create Trigger Wizard appears.
  6. On the Welcome page, enter a unique name for the new trigger.
  7. Click Next.
  8. On the Events page, select one or more events to cause the trigger to fire.
  9. Click Next.
  10. On the Level page, indicate whether the trigger is to fire at the row or statement level.
  11. Click Next.
  12. On the SQL page, enter the statement to be executed when the trigger fires. Triggers do not fire after the execution of LOAD TABLE, TRUNCATE, or WRITETEXT statements.
    The statement window provides a template on which to build the trigger statement. The parameters displayed are based on the options selected in the preceding pages. Once you have made any changes in the statement window, if you return to any of the preceding pages and change any option, when you return to the SQL page, the contents of the statement window is overwritten with the base template; any customizations are lost.
  13. Click Next.
  14. On the Comment page, enter an optional comment.
  15. Click Finish.
    Note: Unlike other wizards launched from the properties view, changes to triggers take effect immediately. You do not need to click OK or Apply in the properties view to upload the change to the database.
Related tasks
Authenticating a Login Account for a Managed Resource