koyrist has asked for the wisdom of the Perl Monks concerning the following question:
I've also setup the temp column in Music/Artist.pmMusic::Artist->set_sql(most_cds => qq{ SELECT artist.id, COUNT(cd.id) AS cds FROM artist, cd WHERE artist.id = cd.artist GROUP BY artist.id ORDER BY cds DESC LIMIT 10 }); my @artists = Music::Artist->search_most_cds();
Everything appears to be fine and if I execute the SQL directly in the database I get the appropriate results with the counts that are correct. However, when the perl code spits out the data it appears to be missing the count (temporary cds column) on the first result. I've confirmed this by using Data::Dumper and this is what I'm seeing on my end (edited to match example).__PACKAGE__->columns(TEMP => qw/cds/);
It's really late and that may have something to do with why I'm stumped but it's not making any sense what-so-ever.$VAR1 = bless( { '__triggers' => {}, '_class_trigger_results' => [], ' +id' => '1' }, 'Music::Artist' ); $VAR2 = bless( { '__triggers' => {}, '_class_trigger_results' => [], ' +cds' => '2', 'id' => '2' }, 'Music::Artist' );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: [mod_perl] Class::DBI temp columns missing on first result
by koyrist (Novice) on Sep 06, 2012 at 14:16 UTC | |
|
Re: Class::DBI temp columns missing on first result
by pvaldes (Chaplain) on Sep 06, 2012 at 11:25 UTC | |
by koyrist (Novice) on Sep 06, 2012 at 13:37 UTC |