<br><tt><font size=2>Matthias Zeichmann <matthias.zeichmann@gmail.com>
wrote on 06/01/2012 01:04:58 PM:<br>
<br>
> From:</font></tt>
<br><tt><font size=2>> <br>
> Matthias Zeichmann <matthias.zeichmann@gmail.com></font></tt>
<br><tt><font size=2>> <br>
> To:</font></tt>
<br><tt><font size=2>> <br>
> The elegant MVC web framework <catalyst@lists.scsys.co.uk></font></tt>
<br><tt><font size=2>> <br>
> Date:</font></tt>
<br><tt><font size=2>> <br>
> 06/01/2012 01:07 PM</font></tt>
<br><tt><font size=2>> <br>
> Subject:</font></tt>
<br><tt><font size=2>> <br>
> Re: [Catalyst] wrong generated SQL</font></tt>
<br><tt><font size=2>> <br>
> On Fri, Jun 1, 2012 at 6:55 PM, Kenneth S Mclane <ksmclane@us.ibm.com>
wrote:<br>
> > Can someone tell me why this:<br>
> ><br>
> > my $rs1 = $c->model('ORANGES::File')->search({'report_id'
=> $rptcode}, {<br>
> > rows
=> 1,<br>
> > page
=> $page,<br>
> > });<br>
> ><br>
> > Results in the following SQL?<br>
> ><br>
> > SELECT COUNT( * ) FROM HCDB_TEST.FILE me WHERE ( report_id =
? ): '541861'<br>
> ><br>
> > When it used to create SQL that actually pulled the fields. It
was working<br>
> > and I have had to re-create several of my template files which
is how I<br>
> > discovered this. I made no changes to this code and suddenly
it is<br>
> > generating this count(*) instead of getting the columns.<br>
> <br>
> you probably used something like .all, .first or a while loop with<br>
> .next on your resultset in your template.<br>
> unless you do so again, no actual results are going to be fetched
from<br>
> your database<br>
> <br>
> you might just as well use "find" instead of search if you
are only<br>
> going for one row<br>
> <br>
> </font></tt><a href=https://metacpan.org/module/DBIx::Class::ResultSet><tt><font size=2>https://metacpan.org/module/DBIx::Class::ResultSet</font></tt></a><tt><font size=2><br>
> <br>
> cheers m<br>
> -- <br>
> siggen.pl: Segmentation Fault<br>
I did use .next in my template, but this code should (and did) return 4
rows. I am also using a pager on the resultset, which still shows 4 pages
when I display the template, however I get no column data, just the count.<br>
</font></tt>