Don't do that. The set_sql() method is for class data that never changes. If you want to build statements on the fly, just grab the $dbh and use prepare_cached(). You can hand the results off to $sth_to_objects. See the Ima::DBI section of the Class::DBI docs for an example.