Using database trigger, What is a database trigger, Using the database trigger – QuickLabel NiceWatch User Manual

Page 38

Advertising
background image

Working with Triggers

38

NiceWatch User Guide

Using Database Trigger

What is a Database Trigger

The Database Trigger periodically checks a defined database, if there are new or updated
records available in user-defined intervals. Four types of database triggers are supported:

Get records based on a unique incremental value: This option will require the

table to have key (autoinc) field. NiceWatch will internally remember which value
was last processed and will only select records that were not processed yet. After
new records are processed by NiceWatch, NiceWatch will remember the value of
the key field of the last processed record. The user will have to set the table and
name of the key field.

Get records and delete them: The user will only have to set table. All records

returned by this SQL will be processed by NiceWatch. After each record is
processed, the record will be deleted from the table.

Get records and update them: The user will have to set the table, update field and

update value. All records returned by this SQL (all records where the update field
value is different than the update value) will be processed by NiceWatch. After
each record is processed, the update field of that record will be set to the update
value, so that the next time this same record is not returned.

Get and manage records with custom SQL: The user will be able to write a

custom SQL to get records and update records.

Using the Database Trigger

To define the trigger, do the following:

1. Select the command Add Trigger from the Edit menu.
2. Select the command Database.
3. The properties of the new database trigger will open.

Note:
You can also click on the Database Trigger icon in the trigger toolbar.

4. On the Database tab, define the Database Connection and Execution Event. For

a basic description of events, see the What is a Database Trigger topic.

5. Set the database connection and update settings in Execution Options.

Go to the Action tab.

Define the actions that should be executed, when the trigger occurs. Click on the

OK button.

The trigger is ready for use.

If the database trigger provides data values for the labels, you will have to extract the
values from the incoming data and transfer them to the variables. Do the following:

1. Double click the database trigger to open its properties.

Advertising