Schemas Tab - Database Options Dialog Box

Schemas Tab

Column/Parameter Section

For recordset statements, TestStand expects the recordset to return the specified column names. The order of the columns in the list control is arbitrary. For command statements, TestStand creates a parameter for each item in the list. Depending on whether the parameter is an input or an output operation, TestStand will set or get the value. While the name of the parameter is arbitrary, the order of the parameters in the list must match the required parameters for the statement. For parameterized statements, the order of the parameters in the list must correspond to the required parameters for the statement.

The Columns/Parameters section contains the following options:

  • Name —Edits the name of the column or parameter. For recordset statements, the name must match a column in the returned recordset. For parameterized statements, the name is arbitrary.
  • Type —The data type of the column or parameter value. The following options are available in the ring control: Small Integer, Integer, Big Integer, Unsigned Big Integer, Float, Double-Precision, String (BSTR), String (varchar), Boolean, Binary, Date/Time, and GUID.
  • Size —The maximum number of bytes TestStand writes to or reads from a column or parameter. If the column does not have a size limitation, you can specify 0 to instruct TestStand to write or read the entire value.
    Note Database logging schemas that use stored procedures reserve memory to buffer the logging of large binary column values. If you configure database logging to open a separate connection for each socket and you use the Parallel or Batch process models with a high number of test sockets, database logging can report an out-of-memory error. Enable the Share Data Link Between Executions option on the Data Link Options section of the Database Options dialog box, or lower the limit on the size of binary data that TestStand logs for each binary column.
  • Direction —Specifies whether the column or parameter is an input or output value. The following options are available in the ring control:
    • Input —TestStand writes the column value or parameter to the database.
    • Output —Specifies whether TestStand retrieves the column value or parameter from the database. This option is valid only for statements of type stored procedure.
    • Input/Output —Specifies whether TestStand writes and retrieves the column value or parameter. This option is valid only for statements of type stored procedure.
    • Return Value —TestStand retrieves the parameter value as a return value from the database. This option is valid only for statements of type stored procedure.
  • Expected Properties —The properties that must exist before TestStand assigns or retrieves a value for the column or parameter. Leave this control empty to instruct TestStand not to require any expected properties.
  • Precondition —An expression that must evaluate to True before TestStand assigns or retrieves a value for the column or parameter. Leave this control empty to instruct TestStand not to apply a precondition.
  • Value to Log/Value —An expression the column or parameter evaluates to obtain the input value to log or the variable property location to store the retrieved output value, respectively.
    Note When the database logger does not evaluate a column expression at run-time because the properties listed in the Expected Properties control do not exist or the Precondition expression evaluates to False , the database logger assigns a NULL value to the database column. When the database logger evaluates an Expression for a column of type string , and the value returned from the expression is empty, the database logger assigns an empty string value to the column.
  • Format —Instructs TestStand how to format a Date/Time string or array value when assigning the column value. Select a format from the list or type a custom format in the edit box. This control is enabled only when the column type is Date/Time or binary. Refer to Logging Binary and String Database Values for more information about writing values to binary and string columns.
  • Primary Key —Enable this section to specify that the database column is a primary key. The primary key column must contain unique values.
    • Type —Specifies how TestStand obtains a unique primary key value to assign to a new record. The following options are available in the ring control:
      • Auto Generated/Counter —TestStand requests the value the database assigns to the new record.
      • Store GUID Value —TestStand generates a unique string value. The database column type must be GUID or String and must use at least 36 bytes for a string.
      • Get Value from Recordset —TestStand executes the SQL command specified in the Command Text control and retrieves the value returned in the first column in the first record of the recordset.
      • Get Value from Output Parameter —TestStand executes the SQL command specified in the Command Text control and retrieves the value returned as an output parameter.
      • Get Value from Return Value —TestStand executes the SQL command specified in the Command Text control and retrieves the return value.
      • Use Expression Value —TestStand evaluates the value specified in the Expression control to determine the primary key value. The primary key value must evaluate to a unique value for the specified column or parameter.
    • Command Text —The text of a command the statement issues against the data link to obtain the primary key value. Only use this control when you select Get Value from Recordset or Get Value from Output Parameter in the Type ring control.
    Note Multiple primary keys are not supported in a single statement.
  • Foreign Key —Enable this section to specify that the database column is a foreign key. A foreign key is a column that references a primary key in a table.
    • Statement —Select the statement that contains the primary key column in which the foreign key references. TestStand automatically assigns the primary key value to the column or parameter. TestStand logs data in the order of statements in the schema. A foreign key statement is valid if the database table to which the foreign key statement logs is logged before the selected statement logs. To log a valid foreign key, select the foreign key statement in one of the following ways:
      1. Choose a statement that is above the parent statement (statement of the selected column) or select the parent statement.
      2. Choose a statement such that the database table to which the chosen statement logs is logged before parent statement (statement of the selected column) logs the data.
      Note that the foreign key statement ring control lists valid statements only if the statement type is not "Stored Procedure". If the statement type is "Stored Procedure", the ring control lists all statements.
Note The default TestStand database schemas do not log attribute values for result properties.

See Also

Format Strings for Database Date Values

Logging Attribute Values

Logging Binary and String Database Values