Developing OTDs for Database Adapters

ProcedureAdd Prepared Statements

Add a Prepared Statement object to your OTD.

Steps Required to Add Prepared Statements Include:


Note –

When using a Prepared Statement, the ”ResultsAvailable()’ method will always return true. Although this method is available, you should not use it with a ”while’ loop. Doing so would result in an infinite loop at runtime and will stop all of the system’s CPU. If it is used, it should only be used with the ”if’ statement.


  1. On the Add Prepared Statements window, click Add. The Add Prepared Statement window appears.

    Figure 1–19 Prepared Statement

    Prepared Statement

  2. Enter the name of a Prepared Statement or create a SQL statement by clicking in the SQL Statement window. When finished creating the statement, click Save As giving the statement a name. This name will appear as a node in the OTD. Click OK. See the following figure.

    Figure 1–20 Prepared SQL Statement

    Prepared SQL Statement

  3. On the Add Prepared Statement window, the name you assigned to the Prepared Statement appears. To edit the parameters, click Edit Parameters. You can change the datatype by clicking in the Type field and selecting a different type from the list.

  4. Click Add if you want to add additional parameters to the Statement or highlight a row and click Remove to remove it. Click OK. Figure 1–21.

    Figure 1–21 Add Prepared Statement window

    Add Prepared Statement window

  5. To edit the parameters, click Edit Parameters. You can change the datatype by clicking in the Type field and selecting a different type from the list.

    Figure 1–22 Edit the Prepared Statement Parameters

    Edit the Prepared Statement Parameters

  6. Click Add to add a new ResultSet column. Both the Name and Type are editable.

    Figure 1–23 ResultSet Columns

    ResultSet Columns

  7. Click OK to return to the Add Prepared Statements window.