Debug Procedure

Use the Debug Procedure dialog box to test and step through the procedure logic that Host Integrator uses to fulfill SQL requests. This allows you to debug your procedure definitions before deploying your model.

You can display the Debug Procedure dialog box in two ways, by either clicking the Debug button in the Test Procedure dialog box, or by clicking the Debug button in the SQL Test dialog box.

To perform procedure debugging, you must either be connected to the host and have access to the application the model is based on, or you must load model in the Host Emulator and connect to it.

Debugging a Procedure

To debug a procedure, follow these steps:

  1. Click Debug in either the Test Procedure or Test SQL dialog box.

    The Debug Procedure dialog box appears. In the Stack context box, Host Integrator displays the context of the currently executing procedure or SQL query. If you are testing an SQL statement in the Test SQL dialog box, the statement you are testing displays and the filters from the WHERE clause of the SQL statement display in the Filters box. If you are testing a procedure in the Test Procedure dialog box, the procedure you are testing displays in the format TableName.ProcedureName.

  2. Click Run to test the procedure.

    Host Integrator will test the procedure and display the results of the query in the Outputs box (if any).

Stepping through a Procedure's Logic

To step through a procedure's logic one step at a time, follow these steps:

  1. Click Debug in either the Test Procedure or Test SQL dialog box.

    The Debug Procedure dialog box appears. In the Stack context box, Host Integrator displays the context of the currently executing procedure or SQL query. If you are testing an SQL statement in the Test SQL dialog box, the statement you are testing displays. Any data or filter parameters that are compared to recordset fields or output parameters (in the case of an SQL query requesting a subset of what the procedure provides) appear in the Filters box. If you are testing a procedure in the Test Procedure dialog box, the procedure you are testing displays in the format TableName.ProcedureName.

  2. Click Step Into.

    In the Commands box, the complete logic for the current procedure displays. The yellow arrow points to the line being evaluated.

    Note:The syntax of the command language is generated by Host Integrator. You cannot modify it.

  3. To step forward through the procedure logic one line at a time, click Step.

    Each time you click Step, Host Integrator proceeds to the next line; As it finds the data that fulfills the procedure, the data displays in the Output box. If the Terminal window is visible, you will see the Design Tool navigate to the appropriate host screen while it fulfills the SQL query.

  4. Click Step Out to end the step through and return to the previous level.

Setting a Break Point

The Debug Procedure feature includes the ability to set a break point in a procedure which pauses the operation at a chosen point. This aids in debugging procedure logic.

To set a break point, follow these steps:

  1. In the Commands box, click the line of code where you want to set the break point.

  2. Click Set Break.

    A red circle appears to the left of the line, indicating the break point that you set. The next time you run a procedure test, the Design Tool will stop the operation at this line.
  3. To remove the break point, click the line containing the break point and click Remove Break.
Related Topics
Bullet Mapping parameters
Bullet Creating procedures