1. Create the save set using mi_save_set_create().
2. Send the statement that selects rows from the database using; for example, mi_exec().
3. When mi_get_result() returns MI_ROWS, initiate an mi_next_row() loop to get the rows.
4. Inside the mi_next_row() loop, for each row that you want to insert into the save set, invoke mi_save_set_insert().