background image
<< To correlate the queries | new variable >>
<< To correlate the queries | new variable >>

Correlating Queries with Binding—

Database Vuser Scripts · Correlating Database Statements
Creating Vuser Scripts
Chapter 10, page 179
Correlating Queries with Binding--Example
The following example illustrates a correlated query that uses binding. The user
performs the same query as above, but instead of using a constant, he specifies a
placeholder name,
id
. The lrd_assign_bind statement assigns the retrieved value
to a host variable.
lrd_stmt(Csr1, "select id from employees where name='John'", ...);
lrd_bind_col(Csr1,...);
lrd_exec(Csr1, ...);
lrd_fetch(Csr1, 1,...);
lrd_stmt(Csr1, "select salary from payment where year='1996' and
id=:id",...);
lrd_assign_bind(Csr1, "id", "777", &id_D4, ...);
lrd_exec(Csr1, ...);