RE: TEMP column created via set_sql and MySQL DATE_FORMAT functionreturns 0 in Class::DBI but valid data from command-line
[prev]
[thread]
[next]
[Date index for 2005/02/15]
On Tue, 2005-02-15 at 15:24 -0800, Terrence Brannon wrote:
> Hmm, what I am doing here is very similar to the example in perldoc
> Class::DBI
>
> Music::Artist->set_sql(most_cds => qq{
> SELECT artist.id, COUNT(cd.id) AS cds <<<<-----
> synthetic column!
> FROM artist, cd
> WHERE artist.id = cd.artist
> GROUP BY artist.id
> ORDER BY cds DESC
> LIMIT 10
> });
The difference is that in this example the only field that isn't part of
the actual table is the TEMP field. In yours, it looks to me like some
of the fields you list in Essential are not really in the table. I
might just be reading it wrong though.
The example you're referring to in the docs is kind of a hack, even
though it will usually work. I still would advise against doing complex
reporting queries through Class::DBI. It just isn't built for that and
you are likely to turn up problems when using it that way.
- Perrin
|
(message missing)
|