Running SQL statements with checkpoints

You can add checkpoints to lines in the SQL and XQuery editor to help you verify results at specific points in a set of statements. When the statements are run from the SQL and XQuery editor, each checkpoint causes the run environment to stop running until you start it again.

About this task

Adding checkpoints to your statements gives you the option to run only a subset of the statements so that you can verify the results before you continue to run the remaining statements. When you add a checkpoint to your statements, all the statements before that checkpoint are run when you click Run SQL. For example, you can add multiple checkpoints to a large set of statements to run the statements in separate groups and verify the results as each group of statements is run. If multiple statements are on a single line, adding a checkpoint to that line excludes all statements on that line from being run with any statements before the checkpoint.
Tip: You can use checkpoints in combination with the run options to run and verify the results of your statements, including the run options Run statements starting from the cursor location and Run selected statements. For example, you can place your cursor at any statement or in between any two checkpoints and then click Run statements starting from the cursor location in the run menu Run menu to run only the statements from the position of the cursor to the next checkpoint.

Procedure

To run SQL statements with checkpoints:

  1. In the SQL and XQuery editor, add checkpoints to each statement that you want to specify as a stopping point by right-clicking the area directly before the statement and then clicking Add Checkpoint. Checkpoints that are added to the first statement are ignored.
    Tip: To remove a checkpoint, right-click the checkpoint and then click Remove Checkpoint.
  2. Run the statements with any of the following run options:
    Run all statements
    Runs all the statements in the SQL and XQuery editor starting from the first statement and stops at the first checkpoint.
    Run statements starting from the cursor location
    Runs all the statements in the line where the cursor is positioned and stops at the next checkpoint.
    Run selected statements
    Runs only the statements that you select but stops at the first checkpoint in the selection.
  3. If needed, run the remaining statements or continue to the next checkpoint. Ensure that your cursor is positioned in the line of the most recent checkpoint and then click Run statements starting from the cursor location. Repeat this step until all of the statements run.
  4. Optional: Save the statements and all the checkpoints by clicking File > Save.

Feedback