Schemas Tab - Database Options Dialog Box

Schemas Tab

Statement Section

Statements define the type of results on which the schema operates and the conditions that must be True before TestStand logs the results. Statements also define the database action to perform. In addition, statements specify what database columns or parameters to log and what TestStand expressions to evaluate in order to determine the column or parameter values.

The Statements section contains the following options:

  • Name —Edits the name of the statement. Typically, the statement name has the same name as the database table to which it logs data.
  • Type —The type of statement. You can select one of the following options from the ring control:
    • Recordset —When you enable this option, the statement returns a recordset. For the columns defined on the Columns/Parameters section, TestStand inserts a new record into the recordset. You would typically use an SQL SELECT command that returns a recordset with this option.
    • Command —When you enable this option, TestStand executes a command for each result that applies to the statement. For each column defined on the Columns/Parameters section, TestStand creates a parameter. This type of statement is called a parameterized statement. For input parameters, TestStand assigns the column value to the parameter before executing the statement. For output parameters, TestStand retrieves the parameter value after executing the statement. You would typically use an SQL INSERT command that contains the question mark "?" keyword to specify the parameters.
    • Stored Procedure —When you enable this option, TestStand executes a stored procedure for each result that applies to the statement. For each column defined on the Columns/Parameters tab, TestStand creates a parameter. For input parameters, TestStand assigns the column value to the parameter before executing the statement. For output parameters, TestStand retrieves the parameter value after executing the statement. Stored procedures can also return a value in addition to output parameters.
      Note If you attempt to use on-the-fly database logging with a schema that uses stored procedure statements or command statements that do not use the SQL INSERT command, you cannot define constraints for foreign keys in step result statements that reference primary keys in a UUT result statement or foreign keys in a step result statement that references their own primary keys. If you define constraints for these types of foreign keys, an error will occur because the on-the-fly database logger cannot execute the statement to create the record that contains the primary key before executing the statement to create the record that contains the foreign key.
  • Command Text —The text of a command the statement issues against the data link. While this is typically an SQL SELECT or SQL INSERT statement, you can use any type of command statement the database provider recognizes, including stored procedure calls.
  • Apply To —The class of results on which the statement operates. The following options are available in the ring control:
    • UUT Result —TestStand applies the statement once per UUT.
    • Step Result —TestStand applies the statement to each step result.
    • Property Result —TestStand applies the statement to each subproperty of a step result.
  • Types to Log —The data types of results for which the statement applies. For step results, the type must be the name of a TestStand step type. For property results, the type must be the name of a TestStand data type. This option does not apply to a UUT Result. Leave the control empty to instruct TestStand not to require any type matching.
  • Expected Properties —The properties that must exist before TestStand applies the statement to a particular result. Leave the control empty to instruct TestStand not to require any expected properties.
  • Precondition —An expression that must evaluate to True before TestStand applies the statement to a particular result. Leave the control empty to instruct TestStand not to apply a precondition.
  • Cursor Type —The type of server or client cursor for the statement. The following options are available in the ring control:
    • Unspecified —Do not specify a cursor type.
    • Forward Only —Identical to a static cursor except you can only scroll forward through records. This option improves performance when you want to make a single pass through a set of records.
    • Keyset —Similar to dynamic cursor, except you cannot see records other users add. Records other users delete are inaccessible from your set of records. Data changes by other users within records are visible.
    • Dynamic —Additions, changes, and deletions other users perform are visible. All types of movement through the set of records are allowed.
    • Static —Additions, changes, and deletions other users perform are not visible.
  • Cursor Location —Specifies where the data source maintains cursors for a connection. The following options are available in the ring control:
    • Server —Uses cursors the data provider supplies. These cursors are sometimes very flexible and allow for additional sensitivity to reflect changes other users make to the actual data.
    • Client —Uses client-side cursors a local cursor library supplies. Local cursor engines often allow many features driver supplied cursors do not.
  • Lock Type —Specifies when the data source locks a record. The following options are available in the ring control:
    • Unspecified —Do not specify a lock type.
    • Read Only —You cannot alter the data in a record.
    • Pessimistic —The provider does what is necessary to ensure successful editing of the records, usually by locking records at the data source immediately upon editing.
    • Optimistic —The provider only locks records when you send the data back to the database.
    • Batch Optimistic —Required for batch updates.
      Note If you attempt to set the lock type to Read-Only for the record set statement where one or more statements in the schema has foreign key dependency on the statement and Use On-The-Fly is set for database logging, On-the-fly database logger may not be able to update the recordset.
  • Traversing Options —Launches the Traversing Options dialog box, in which you can specify if subsequent statements can process the current UUT, the step or property result, or the sub-results of the step or property result.

See Also

Traversing Options dialog box