Using DataDirect Test™ : DataDirect Test™ Tutorial : Executing a Prepared Statement

Executing a Prepared Statement
This example explains how to execute a parameterized statement multiple times.
To Execute a Prepared Statement:
1.
From the Connection window menu, select Connection / Create Prepared Statement. DataDirect Test prompts you for a SQL statement.
2.
Type an Insert statement and click Submit. Then, click Close.
Get Prepared Statement SQL dialog box with an example Insert statement displayed
3.
Select Statement / Set Prepared Parameters. To set the value and type for each parameter:
a.
b.
c.
d.
Click Set to pass this information to the JDBC driver.
Set Prepared Statement Parameters dialog box with example values
4.
5.
Select Statement / Execute Stmt Update. The JDBC/Database Output scroll box indicates that one row has been inserted.
Connection window showing one row has been inserted
6.
7.
If you repeat the steps described in Executing a Simple Select Statement, you will see that the previously inserted records are also returned.
Connection window showing that the previously inserted records are also returned

© 2012 Progress Software Corporation and/or its subsidiaries or affiliates.