in reply to Trying to search using Class::DBI

If 'IssueBot::DBI' inherits from Class::DBI::SQLite (instead of from Class::DBI directly) then your IssueBot::Channels class could look like this:

package IssueBot::Channels; use strict; use warnings 'all'; use base 'IssueBot::DBI'; __PACKAGE__->set_up_table('channel_prefs'); 1;# return true
Everything *should* just work. You might hear some complaining about "statement handle still active for query blah blah blah..." but that's it.

Replies are listed 'Best First'.
Re^2: Trying to search using Class::DBI
by swares (Monk) on May 28, 2008 at 20:19 UTC
    Thanks, using Class::DBI::SQLite directly makes things easier and eliminates the error I was getting. Then I got a no such column error:
    DBD::SQLite::db prepare_cached failed: no such column: true(1) at dbdi +mp.c line 271 [for Statement "SELECT id FROM channel_prefs WHERE active = true "] at /usr/local/lib/perl5/site_perl/5.8.8/Ima/DBI.pm line 398.
    Looks like most of my other issues are mostly due to looking at differing examples then hard coding the data (poorly) into the initial code. Using place holders and/or quoting the key values properly eliminates this column not found problem. I think improper quoting is making it use the key and value together (keeping the value) for the table name.