Example: lrd_assign_ext

In the following example, lrd_assign_ext assigns values to the host variable F_D1 from an array called name. The lrd_bind_placeholder function binds the host variable to the placeholders F and L. The name array was defined at the beginning of the section as

    char name[15]. 

The actual recorded code was:

 /* Insert employee data into the employee table. */
lrd_stmt(Csr2, "insert into employees (emp_firstname,emp_lastname)" "values(:F,:L)", -1, 1 /*Deferred*/, 1 /*Dflt Ora Ver*/, 0);
lrd_assign(&F_D1, "Jim", "", 0, 0);
lrd_assign(&F_D1, "Bob", "", 1, 0);
lrd_assign(&F_D1, "Mike", "", 2, 0);
lrd_bind_placeholder(Csr2, "F", &F_D1, 0, 0);
If the names contain null characters and are variable length, you modify the existing code in the following way:
lrd_assign_ext(&F_D1, name[0], 5, "", 0, 0);
lrd_assign_ext(&F_D1, name[1], 6, "", 1, 0);
lrd_assign_ext(&F_D1, name[2], 6, "", 2, 0);
lrd_bind_placeholder(Csr2, "F", &F_D1, 0, 0);