18.01.2015 Views

Technical Reference Manual - InduSoft

Technical Reference Manual - InduSoft

Technical Reference Manual - InduSoft

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Background Tasks<br />

The header of the database worksheet is configured as follows:<br />

• Description field: Enter a description of the worksheet, for documentation purposes.<br />

• Status field: Enter the name of a numeric tag that will receive status codes for database operations during<br />

runtime:<br />

Status codes for external database operations<br />

Status Code<br />

Description<br />

4 Result set is empty<br />

3 Cursor released and query successfully closed<br />

2 Beginning of result set reached, usually while moving cursor to previous row<br />

1 End of result set reached, usually while moving cursor to next row<br />

0 No errors; status normal<br />

-1 Error while connecting to specified database (see Connection below)<br />

-2 Error while selecting result set<br />

-3 Error while moving cursor to next row (see Next trigger below)<br />

-4 Error while moving cursor to previous row (see Previous trigger below)<br />

-5 Error while closing the query (see Close Query trigger below)<br />

-6 Error while inserting rows in result set (see Insert trigger below)<br />

-7 Error while updating result set (see Update trigger below)<br />

-8 Error while deleting result set (see Delete trigger below)<br />

• Completed field: Enter the name of a numeric tag that will be toggled when database commands are<br />

successfully executed.<br />

• Error Message field: Enter the name of a string tag that will receive detailed error messages, if errors occur<br />

during runtime.<br />

• Connection combo-box: Click to select a connection to the target database. All available connections are<br />

listed, as configured with the Database Connection dialog described above.<br />

• Type combo-box: Click to specify how the result set will be selected for the worksheet:<br />

• Table: Enter a table name and an optional filter condition. (The filter condition is equivalent to the SQL<br />

"Where" clause.) All rows of the table that match the filter condition are selected.<br />

• SQL: Enter a custom SQL "Select" statement.<br />

Note: For Table, Condition and SQL Statement, you can enter the names of project tags that contain<br />

the desired information. This lets you programmatically change the selection during runtime.<br />

However, tag names must be enclosed in curly brackets ({}) to distinguish them from literal<br />

strings. Also, you must release an existing selection before you open a new one; see Close Query<br />

below.<br />

• Cursor Triggers area…<br />

• Select field: Enter any tag; when the value of the tag changes, a new cursor opens the first row of the<br />

result set and copies those values to the tags configured in the worksheet body.<br />

• Next field: Enter any tag; when the value of the tag changes, the cursor moves to the next row of the<br />

result set and copies those values to the tags configured in the worksheet body.<br />

Page 322<br />

<strong>InduSoft</strong> Web Studio

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!