Example: lrd_save_last_rowid

In the following example, the lrd_save_last_rowid function saves a rowid to a parameter and retrieves the salary of the last employee.

 /* Recorded script */
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 id='777' ",...);
lrd_exec(Csr1, ...);
 / * Modified script */
lrd_stmt(Csr1, "select id from employees where name='John'", ...);
lrd_bind_col(Csr1,...);
lrd_exec(Csr1, ...);
/* Call lrd_fetch prior to lrd_save_last_rowid */
lrd_fetch(Csr1, 1, ...);
lrd_save_last_rowid(Csr1,"last_row_id");
lrd_stmt(Csr1, "select salary from payment where rowid='{last_row_id}' ", ...);
lrd_exec(Csr1, ...);