How to Define a SQL Task and its Statements

Previous Next

See Also

To define a SQL task and its statements:

1. Choose Define, Tasks, SQL Tasks from the menu bar.

The SQL Tasks window appears.

2. In the SQL Task Name field, type a unique name for the SQL task. The name can be up to 30 characters long.
3. Click the SQL Statements tab to enter information in the following fields.

For each SQL statement that this task is to execute:

· In the Sequence field, type a (sequence) number to indicate the order in which the SQL statements are to be executed. If you have more than a few statements, it is a good idea to number from 10 onwards, in increments of 10. In this way, you can always insert statements later, if necessary.

 

· In the Active field, check or clear the box to activate or deactivate any statements. This enables you to include statements for debugging purposes, and deactivate them later, if required.

 

· In the Disable Rules field, check or clear the box to specify whether rules (constraints, relationships, mandatory columns, allowed values, and more) need to be disabled or not when executing this SQL statement. This enables you to speed up performance when the data comes from a trusted source and is therefore expected not to contain any errors. Refer to "Disabling Rules" for more information.

 

· In the SQL Statement field, type the text of your SQL statement. Click the Edit button to open the popup Text Editor or click the SQL Definer button to open the SQL Definer.

 

· In the Description field, type a short but meaningful text to describe the purpose of the SQL Statement.

NOTE 1:

Using the SQL Definer is particularly useful because it is recommended that you specify all relevant columns of a table. If you do not use the SQL Definer, you will need to look up the column names and the order in which they appear.

NOTE 2:

To view Log Information changes, click the Log Info tab. You can use the What's This? Help in the Log Information tab page for more information on each field.

NOTE 3

You can check the validity of the SQL statements by pressing the Check button. If the statements are correct, the Correct flag for the SQL Task will be set to correct, that is, the checkbox will be checked. This is not a mandatory action, the state of the correct flag has no effect on the execution of the SQL Task.