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