Custom sql statements – QuickLabel NiceWatch User Manual

Page 39

Advertising
background image

Working with Triggers

39

NiceWatch User Guide

2. Go to the Variables tab.
3. Define the variable that exist on the label.

Note:
You can manually define the variables or import them from the label file. If you are
creating variables manually, make sure to use the same names as the names defined in the
label.

4. Go to the Filter tab.
5. Tick the option Use filter to enable filter functionality.
6. Select the appropriate Filter type that matches the format of the incoming data.
7. Define the fields in the incoming data stream.
8. Link the fields with the variables.
9. Click on the button Verify the Definition to test the processing of your filter.

10. Click on the OK button.

Note:
If you do not set a filter and connect it to label variables, the trigger will not be able to
print out more than one label in cases where several records are retrieved.

Custom SQL Statements

The use of advanced Custom SQL Statements is available with the Get and manage
records with custom SQL
event type. Click the Define... button to access these
advanced settings.

The user is able to write custom SQL commands, used to get and update records. SQL
uses parameters for this operation.

Examples:

Get values from the Articles table for all records, where the "printed" value is set to false
(the record was not printed yet).

SELECT articleID, articlename, printed FROM articles
WHERE printed = false

The trigger processes each of these records and calls the bottom query.

UPDATE articles
SET printed = true
WHERE articleID = :articleID

It is possible to use parameters, which are fields from the first query. In this case, the
parameter :articleID would return the Article ID of the record, which was processed.

For databases that do not support deleting or updating records, only the Key field type
database trigger is possible (Excel for example). All field names from the source data

Advertising