Db2 Stub Editor


The Db2 stub editor allows you to enter the values to be returned when the stub target is invoked during the execution of a test case that includes the stub.

The name listed in the Description column for the stub identifies the SQL statement type, for example OpenInsertSelect, etc..

The only right-click option in the Description column is:

  • Rename

SQL Statement or SQL Cursor

To view the captured SQL Statement click on the SQL Statement or SQL Cursor button on the top of the window. It expands the SQL Statement partition of the Editor area and displays the SQL statement in a scrollable area.

Selection Criteria

If the SQL Statement allows editing, click the Selection Criteria tab below the SQL Statement or SQL Cursor area. It displays the SQL Selection Criteria. You may change values in the Value and NULL Indicator columns where applicable. Double-click the displayed value of the Value field to edit the value. When you double-click the value in the NULL Indicator field, click on the checkbox to toggle between NULL and Non-NULL. Changing the field value from Non-NULL to NULL will automatically remove the corresponding value in the Value column. The original value will be restored when toggling the NULL field back to Non-NULL.

Modify Length

To change the length of a field, right-click on a field and select Modify length. Depending on the field definition, the Modify Length dialog presents tailored for character, variable length, or numeric/decimal element. The dialog shows the current field definition (Field name, Picture, and Length); for Decimal, Length is broken up in number of digits to the left and right.

Character field:

  1. Enter the new length in the New length: field.
  2. Select Right or Left to specify where to add or remove bytes to or from.
  3. If applicable, specify the padding character to use when increasing the length. Available choices are SPACES, ZEROS, LOW-VALUES (X'00'), HIGH-VALUES (X'FF'), Character, or Hex string.
  4. Press OK.

Numeric/Decimal field:

  1. Enter the new number in the New number of digits left of decimal: field.
  2. Enter the new number in the New number of digits right of decimal: field.
  3. Press OK.
    If the new length is shorter, the message "Decreasing the number of digits will truncate data and please verify the generated data." Click OK to accept the shortened length or Cancel the update.

Variable length field:

  1. Enter the new length in the New length: field.
  2. Press OK.
    If the new length is shorter, the message "Decreasing length will truncate data and may cause incorrect length for this varying length element." Click OK to accept the shorter length or Cancel the update.

Output

The Output tab displays the SQL Output VariablesLocationValue, and NULL Indicator columns. Value and NULL Indicator columns can be edited. Modify Length is also available for eligible elements.

Return Code

The Return Code tab displays with the Return Code and Values columns. The values for SQLSTATE and SQLCODE entries can be edited to force the program into the error handling code. For additional information on the SQL Result and SQL error codes, refer to the IBM® Db2® for z/OS® documentation.

Db2Fetch.png

Properties

The Properties tab for Db2 stubs displays the Stub Name, Alias name, Description, and Type information and allows you to change the Alias name, and Description of the stub.

To quickly open the interface, click on the interface name listed under Current Simulation Record Interface.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*