in reply to How do I build a SQL statement in Class::DBI programmatically

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.
  • Comment on Re: How do I build a SQL statements in Class::DBI programmatically

Replies are listed 'Best First'.
Re^2: How do I build a SQL statements in Class::DBI programmatically
by saberworks (Curate) on Dec 08, 2004 at 23:11 UTC
    Agreed - but in simpler terms: Class::DBI is meant to help you more easily do the easy things. It allows you to use objects to do simple interactions with your database. However, when you need more complex queries, it's better to just write them by hand.
      rb3 is already writing them by hand. The problem is the use of set_sql, which is not meant for this.