Example: lrd_assign_bind_ext
In the following example, lrd_assign_bind_ext assigns the contents of the array emp to the host variable newemp_D4 , and then binds the host variable to the placeholder. The array emp, contains the required values, and it was defined as int emp[15] at the beginning of the script.
The actual recorded code was:
lrd_stmt(Csr1, "insert into employee values ('Joe Taylor',:newemp," "'1-JAN-97','R&D',22)", -1, 0 /*Non deferred*/, 2 /*Ora V7*/, 0);
lrd_assign_bind(Csr1, "newemp", "70", &newemp_D4, 0, 0, 0);
lrd_exec(Csr1, 0, 0, 0, 0, 0);
If the names contain null characters and are variable length, you modify the existing code in the following way:
lrd_assign_bind_ext(Csr1, "newemp", emp[1], 9, &newemp_D4, 0, 0, 0);
lrd_exec(Csr1, 0, 0, 0, 0, 0);