<HTML >
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">



<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</HEAD>
<BODY >
<DIV>
<font face="Arial, sans-serif" size="2">
<div>Hi Matt,</div>
<div>&nbsp;</div>
<div>Thanks for the response, however neither solutions are really satisfactory.</div>
<div>&nbsp;</div>
<div>I'll give you a summary of what ive been doing and how I've tackled it. </div>
<div>&nbsp;</div>
<div><font face="Arial, sans-serif">Essentially Ive been<font face="Arial, sans-serif"> creating a reporting framework to allow users to create reports on various datasets held in sqlite databases. </font></font></div>
<div>The idea is that users can create reports on the raw data or based on existing reports.</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>So <font face="Arial, sans-serif">the base reporting module looks as follows, </font></div>
<div><font face="Arial, sans-serif">this is then subclassed by a base report for each db table</font></div>
<div><font face="Arial, sans-serif">Which in turn is subclassed by user created reports.</font></div>
<div>----------------------------------------<font face="Arial, sans-serif">-----------------------------</font></div>
<div>package Reporting::View;</div>
<div>use Moose::role;</div>
<div>&nbsp;</div>
<div>has 'schema' =&gt; ( is =&gt; 'rw',lazy=&gt;1, default =&gt; sub {</div>
<div>&nbsp; my $self = shift;</div>
<div>&nbsp; return Reporting::DB-&gt;connect('dbi:SQLite:'.$self-&gt;dbSource);</div>
<div>});</div>
<div>&nbsp;</div>
<div><font face="Arial, sans-serif">#</font></div>
<div><font face="Arial, sans-serif"># default resultset, reports can manipulate</font></div>
<div><font face="Arial, sans-serif">#</font></div>
<div>has 'resultset' =&gt; ( is =&gt; 'rw',lazy=&gt;1, default =&gt; sub {</div>
<div>&nbsp; my $self = shift;</div>
<div>&nbsp; return $self-&gt;schema-&gt;resultset($self-&gt;dbTable);</div>
<div>});</div>
<div>&nbsp;</div>
<div><font face="Arial, sans-serif">#</font></div>
<div><font face="Arial, sans-serif"># post processes the resultset</font></div>
<div><font face="Arial, sans-serif">#</font></div>
<div>has 'processedResultset' =&gt; ( is =&gt;'rw', lazy=&gt;1, default =&gt; sub {</div>
<div>&nbsp; my $self = shift;</div>
<div>&nbsp; my $rs = $self-&gt;resultset;</div>
<div>&nbsp;</div>
<div><font face="Arial, sans-serif">&nbsp; # apply search /paging</font></div>
<div><font face="Arial, sans-serif">&nbsp; # build whereclaus from cgi params</font></div>
<div><font face="Arial, sans-serif">&nbsp; my $whereClause = map { ... }&nbsp; $self-&gt;cgi-&gt;params;</font></div>
<div>&nbsp; $rs = $rs-&gt;<b>subselect</b>({ <font face="Arial, sans-serif">$</font>where<font face="Arial, sans-serif">C</font>laus }.. { paging..} );&nbsp;&nbsp; # search on resultset</div>
<div>&nbsp;</div>
<div><font face="Arial, sans-serif">&nbsp; #</font></div>
<div><font face="Arial, sans-serif">&nbsp; # add comments to report&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font></div>
<div><font face="Arial, sans-serif">&nbsp; $self-&gt;schema-&gt;storage-&gt;dbh-&gt;do(qq/ATTACH DATABASE &quot;comments.db&quot; as comments/);</font></div>
<div>&nbsp; $rs-&gt;result_class-&gt;might_have( comments =&gt; 'Reporting::Comments', { join cla<font face="Arial, sans-serif">u</font>s }); </div>
<div>&nbsp; $rs = $rs-&gt;<b>subselect</b>({ comments_fields}, { join =&gt; comments }.. );&nbsp;&nbsp; # get comments for the report</div>
<div>&nbsp;&nbsp; .. Other post processing that may add/remove columns<font face="Arial, sans-serif"> like delta between dates..</font></div>
<div>&nbsp; return $rs;</div>
<div>});</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div><font face="Arial, sans-serif">#</font></div>
<div># called by Template Toolkit</div>
<div>#</div>
<div>sub createReport {</div>
<div>&nbsp; my $rs $self-&gt;processedResultset;</div>
<div>&nbsp; my @cols = $rs-&gt;<b>columns</b><font face="Arial, sans-serif"><b>();</b></font></div>
<div>&nbsp;</div>
<div>&nbsp; my @rows;</div>
<div>&nbsp; while (my @row = $rs-&gt;cursor-&gt;next) {</div>
<div>&nbsp;&nbsp;&nbsp; push @rows, \@row;</div>
<div>&nbsp; }</div>
<div>&nbsp; # return a table object that can be rendered into html</div>
<div>&nbsp; return Table-&gt;new(\@cols, \@rows); </div>
<div>}</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>=================================================</div>
<div>A bas<font face="Arial, sans-serif">e</font> report that displays raw data from Foo.db </div>
<div>------------------------------------------------</div>
<div>package Reporting::View::Foo;</div>
<div>&nbsp;</div>
<div>use Moose;</div>
<div>with Reporting::View;</div>
<div>&nbsp;</div>
<div>sub dbSource { 'Foo' };</div>
<div>sub dbTable&nbsp; { 'FooTable' };</div>
<div>sub reportName {' Raw foo report' };</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>=================================================</div>
<div>A sub report that displays only some data from Raw report</div>
<div>------------------------------------------------</div>
<div>&nbsp;</div>
<div>package Reporting::View::Foo<font face="Arial, sans-serif">::View1;</font></div>
<div><font face="Arial, sans-serif">&nbsp;</font></div>
<div>use Moose;</div>
<div>extends Reporting::View::Foo<font face="Arial, sans-serif">;</font></div>
<div><font face="Arial, sans-serif">&nbsp;</font></div>
<div>sub reportName {' sub report of foo'};</div>
<div>&nbsp;</div>
<div>around 'resultset' =&gt; sub { </div>
<div>&nbsp; my ($next,$self) = @_;</div>
<div>&nbsp; $self-&gt;$next</div>
<div>&nbsp; -&gt;search( { col1 =&gt; { in =&gt;[]} }, { select =&gt; [ col<font face="Arial, sans-serif">1 as xxx col2 as yyy</font> ] });</div>
<div>}</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>=================================================</div>
<div>A sub report that <font face="Arial, sans-serif">displays View1&nbsp; using customised col names</font></div>
<div>------------------------------------------------</div>
<div>&nbsp;</div>
<div>package Reporting::View::Foo::<font face="Arial, sans-serif">Raw::View1::Custom</font></div>
<div><font face="Arial, sans-serif">&nbsp;</font></div>
<div>use Moose;</div>
<div>extends <font face="Arial, sans-serif">'</font>Reporting::View::Foo<font face="Arial, sans-serif">::Raw::View1';</font></div>
<div><font face="Arial, sans-serif">&nbsp;</font></div>
<div>sub reportName {' sub report of foo'};</div>
<div>&nbsp;</div>
<div>around 'resultset' =&gt; sub { </div>
<div>&nbsp; my ($next,$self) = @_;</div>
<div>&nbsp; $self-&gt;$next</div>
<div>&nbsp; -&gt;<b>subselect</b>( { <font face="Arial, sans-serif">xxx</font> =&gt; { in =&gt;[<font face="Arial, sans-serif">..</font>]} }, { select =&gt; [ <font face="Arial, sans-serif">'</font>col<font face="Arial, sans-serif">1 as foo', </font> <font face="Arial, sans-serif">'col2
as bar'</font>] });</div>
<div>}</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>=================================================</div>
<div>A sub report that displays <font face="Arial, sans-serif">customer report in a different layout</font></div>
<div>------------------------------------------------<font face="Arial, sans-serif">----------------------</font></div>
<div><font face="Arial, sans-serif">&nbsp;</font></div>
<div>package Reporting::View::Foo::Raw<font face="Arial, sans-serif">::View1::Custom::Alternate</font>;</div>
<div>&nbsp;</div>
<div>use Moose;</div>
<div>extends <font face="Arial, sans-serif">'</font>Reporting::View::Foo<font face="Arial, sans-serif">::Raw::View1::Custom';</font></div>
<div><font face="Arial, sans-serif">&nbsp;</font></div>
<div>sub reportName {' sub report of foo'};</div>
<div>&nbsp;</div>
<div>around 'resultset' =&gt; sub { </div>
<div>&nbsp; my ($next,$self) = @_;</div>
<div>&nbsp; $self-&gt;$next</div>
<div>&nbsp; -&gt;<font face="Arial, sans-serif"><b>roundMins(</b></font><font face="Arial, sans-serif">30, 'time', @groupbycols</font>}<font face="Arial, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #adjusts time value to 30 min intervals</font></div>
<div><font face="Arial, sans-serif">&nbsp; -&gt;<b>groupBy</b>('count(*)','count', @groupbycols}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #group by time col to show counts by 30 min interval</font></div>
<div><font face="Arial, sans-serif">&nbsp; -&gt;<b>pivot</b>('time','0','count,@groupbycols;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #turn the time col into multiple columns</font></div>
<div><font face="Arial, sans-serif">}</font></div>
<div><font face="Arial, sans-serif">&nbsp;</font></div>
<div><font face="Arial, sans-serif">&nbsp;</font></div>
<div><font face="Arial, sans-serif">----------------------------------------------------</font></div>
<div><font face="Arial, sans-serif">&nbsp;</font></div>
<div><font face="Arial, sans-serif">The essense of this is to have a db that looks like </font></div>
<div><font face="Arial, sans-serif">&nbsp;</font></div>
<div><font face="Arial, sans-serif">| Col1 | Col2 | Time |</font></div>
<div><font face="Arial, sans-serif">&nbsp;</font></div>
<div><font face="Arial, sans-serif">&nbsp;</font></div>
<div><font face="Arial, sans-serif">And from it, create reports that looks like </font></div>
<div><font face="Arial, sans-serif">&nbsp;</font></div>
<div><font face="Arial, sans-serif">| Col1 | Col2 | Time | Count |</font></div>
<div><font face="Arial, sans-serif">&nbsp;</font></div>
<div><font face="Arial, sans-serif">And then something like this.</font></div>
<div><font face="Arial, sans-serif">&nbsp;</font></div>
<div><font face="Arial, sans-serif">| myCol1 | myCol2 | 00:00 | 00:30 | 01:00 | &#8230; | 23:30 | </font></div>
<div><font face="Arial, sans-serif">&nbsp;</font></div>
<div><font face="Arial, sans-serif">&nbsp;</font></div>
<div><font face="Arial, sans-serif">All the user needs to do to create the report is create a module with relavent around 'resultset' method - later this may become a yaml file.</font></div>
<div><font face="Arial, sans-serif">&nbsp;</font></div>
<div><font face="Arial, sans-serif">-------------------------------------------------------</font></div>
<div><font face="Arial, sans-serif">&nbsp;</font></div>
<div><font face="Arial, sans-serif">&nbsp;</font></div>
<div><font face="Arial, sans-serif">Ive managed to get all this working - but ive had to hack the following</font></div>
<div><font face="Arial, sans-serif">&nbsp;</font></div>
<div><font face="Arial, sans-serif">DBIx::Class::Storage::DBI&nbsp;&nbsp; </font></div>
<div><font face="Arial, sans-serif">- created a <b>selectSQL()</b> method that returns the current SQL string and</font></div>
<div><font face="Arial, sans-serif">- allows passing of '<b>compound' </b>key for doing Unions/Excepts etc.</font></div>
<div><font face="Arial, sans-serif">&nbsp;</font></div>
<div><font face="Arial, sans-serif">&nbsp;</font></div>
<div><font face="Arial, sans-serif">DBIx::Class::Resultset&nbsp; </font></div>
<div><font face="Arial, sans-serif">- created <b>subselect()</b> that uses the selectSQL() above to populate the 'from' key.</font></div>
<div><font face="Arial, sans-serif">- added <b>'compound'</b> key to search so that you can supply compound =&gt; 'UNION =&gt; selectstatement'';</font></div>
<div><font face="Arial, sans-serif">- added <b>columns() </b>to retrieve the columns from the current resultset.</font></div>
<div><font face="Arial, sans-serif">- added <b>groupBy(), pivot()</b> and a couple of other helper methods that do useful SQL transformations</font></div>
<div><font face="Arial, sans-serif">&nbsp;</font></div>
<div><font face="Arial, sans-serif">&nbsp;</font></div>
<div><font face="Arial, sans-serif">------------------------------------------------------------</font></div>
<div><font face="Arial, sans-serif">It all ends up with some rather scary SQL&nbsp; - but it works rather nicely ;-)</font></div>
<div><font face="Arial, sans-serif">&nbsp;</font></div>
<div><font face="Arial, sans-serif" size="3">S<font face="Arial, sans-serif">ELECT &quot;only_in&quot;, &quot;db_server&quot;, &quot;project&quot;, &quot;00:00&quot;, &quot;01:00&quot;, &quot;02:00&quot;, &quot;03:30&quot;, &quot;04:00&quot;, &quot;04:30&quot;, &quot;05:00&quot;, &quot;05:30&quot;, &quot;06:00&quot;, &quot;06:30&quot;, &quot;07:00&quot;, &quot;17:30&quot;, &quot;19:00&quot;, &quot;21:00&quot;, &quot;21:30&quot;, &quot;22:30&quot;
FROM (SELECT &quot;only_in&quot;, &quot;db_server&quot;, &quot;project&quot;, sum(&quot;00:00&quot;) as &quot;00:00&quot;, sum(&quot;01:00&quot;) as &quot;01:00&quot;, sum(&quot;02:00&quot;) as &quot;02:00&quot;, sum(&quot;03:30&quot;) as &quot;03:30&quot;, sum(&quot;04:00&quot;) as &quot;04:00&quot;, sum(&quot;04:30&quot;) as &quot;04:30&quot;, sum(&quot;05:00&quot;) as &quot;05:00&quot;, sum(&quot;05:30&quot;) as &quot;05:30&quot;, sum(&quot;06:00&quot;)
as &quot;06:00&quot;, sum(&quot;06:30&quot;) as &quot;06:30&quot;, sum(&quot;07:00&quot;) as &quot;07:00&quot;, sum(&quot;17:30&quot;) as &quot;17:30&quot;, sum(&quot;19:00&quot;) as &quot;19:00&quot;, sum(&quot;21:00&quot;) as &quot;21:00&quot;, sum(&quot;21:30&quot;) as &quot;21:30&quot;, sum(&quot;22:30&quot;) as &quot;22:30&quot; FROM (SELECT &quot;only_in&quot;, &quot;db_server&quot;, &quot;project&quot;, (case when time = &quot;00:00&quot;
then count end) as '00:00', (case when time = &quot;01:00&quot; then count end) as '01:00', (case when time = &quot;02:00&quot; then count end) as '02:00', (case when time = &quot;03:30&quot; then count end) as '03:30', (case when time = &quot;04:00&quot; then count end) as '04:00', (case when time
= &quot;04:30&quot; then count end) as '04:30', (case when time = &quot;05:00&quot; then count end) as '05:00', (case when time = &quot;05:30&quot; then count end) as '05:30', (case when time = &quot;06:00&quot; then count end) as '06:00', (case when time = &quot;06:30&quot; then count end) as '06:30', (case
when time = &quot;07:00&quot; then count end) as '07:00', (case when time = &quot;17:30&quot; then count end) as '17:30', (case when time = &quot;19:00&quot; then count end) as '19:00', (case when time = &quot;21:00&quot; then count end) as '21:00', (case when time = &quot;21:30&quot; then count end) as '21:30',
(case when time = &quot;22:30&quot; then count end) as '22:30' FROM (SELECT &quot;only_in&quot;, &quot;db_server&quot;, &quot;project&quot;, &quot;time&quot;, count(*) as count FROM (SELECT &quot;only_in&quot;, &quot;db_server&quot;, &quot;project&quot;, &quot;time&quot; FROM (SELECT '2008-11-13' as only_in, &quot;db_server&quot;, &quot;project&quot;, &quot;time&quot; FROM (SELECT
&quot;db_server&quot;, &quot;project&quot;, &quot;time&quot; FROM (SELECT db_server, project, strftime(&quot;%H:%M&quot;, strftime(&quot;%H:00&quot;,time), &quot;&#43;&quot; || (strftime(&quot;%M&quot;,time)*1/30*30) || &quot; minutes&quot;) as time FROM DBusage me WHERE ( strftime('%H',time) IS NOT NULL ) GROUP BY db_server, project, time)
me EXCEPT SELECT db_server, project, strftime(&quot;%H:%M&quot;, strftime(&quot;%H:00&quot;,time), &quot;&#43;&quot; || (strftime(&quot;%M&quot;,time)*1/30*30) || &quot; minutes&quot;) as time FROM old.DBusage me WHERE ( strftime('%H',time) IS NOT NULL ) GROUP BY db_server, project, time) me) me UNION SELECT '2008-11-11'
as only_in, &quot;db_server&quot;, &quot;project&quot;, &quot;time&quot; FROM (SELECT &quot;db_server&quot;, &quot;project&quot;, &quot;time&quot; FROM (SELECT db_server, project, strftime(&quot;%H:%M&quot;, strftime(&quot;%H:00&quot;,time), &quot;&#43;&quot; || (strftime(&quot;%M&quot;,time)*1/30*30) || &quot; minutes&quot;) as time FROM old.DBusage me WHERE ( strftime('%H',time)
IS NOT NULL ) GROUP BY db_server, project, time) me EXCEPT SELECT db_server, project, strftime(&quot;%H:%M&quot;, strftime(&quot;%H:00&quot;,time), &quot;&#43;&quot; || (strftime(&quot;%M&quot;,time)*1/30*30) || &quot; minutes&quot;) as time FROM DBusage me WHERE ( strftime('%H',time) IS NOT NULL ) GROUP BY db_server,
project, time) me) me GROUP BY db_server, project, time) me) me GROUP BY db_server, project) me WHERE ( ( ( ( ( db_server LIKE '%CDDB%' ) OR ( project LIKE '%CDDB%' ) ) ) ) ) LIMIT 100 </font></font></div>
<div><font size="3">&nbsp;</font></div>
<div><font face="Arial, sans-serif">-----------------------------------------------------------</font></div>
<div><font face="Arial, sans-serif">Since our version 0.8 is broken (no useful errors), ive done this using 0.70050. </font></div>
<div><font face="Arial, sans-serif">My code is pretty hacky so not worth submitting but If you are interested in what I did I can provide more info. </font></div>
<div><font face="Arial, sans-serif">&nbsp;</font></div>
<div><font face="Arial, sans-serif">&nbsp;</font></div>
<div><font face="Arial, sans-serif">Regards, Tom</font></div>
<div><font face="Arial, sans-serif">&nbsp;</font></div>
<div><font face="Arial, sans-serif">&nbsp;</font></div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&gt; -----Original Message-----</div>
<div>&gt; From: Matt S Trout [<a href="mailto:dbix-class@trout.me.uk"><font color="#0000FF"><u>mailto:dbix-class@trout.me.uk</u></font></a>] </div>
<div>&gt; Sent: 12 November 2008 20:40</div>
<div>&gt; To: DBIx::Class user and developer list</div>
<div>&gt; Subject: Re: [Dbix-class] DBIx::Class - Trying to get column </div>
<div>&gt; names from a $rs or $row</div>
<div>&gt; </div>
<div>&gt; On Tue, Oct 14, 2008 at 07:59:44PM &#43;0100, Howe, Tom (IT) wrote:</div>
<div>&gt; &gt; Hi, first post here</div>
<div>&gt; &gt;</div>
<div>&gt; &gt; I have a question regarding&nbsp; getting column names from a </div>
<div>&gt; DBIx ::Class $resultset or $row.</div>
<div>&gt; &gt;</div>
<div>&gt; &gt; I have a DBIx::Class resultset which I'll call $rset</div>
<div>&gt; &gt;</div>
<div>&gt; &gt; I need to get the column names of the resultset in the </div>
<div>&gt; correct order.</div>
<div>&gt; &gt;</div>
<div>&gt; &gt; I was advised&nbsp; by a coleague&nbsp; to use $rset-&gt;result_source-&gt;columns;</div>
<div>&gt; &gt;</div>
<div>&gt; &gt; This have me the column names of the table that was the </div>
<div>&gt; original source of the resultset which initially worked ok.</div>
<div>&gt; &gt;</div>
<div>&gt; &gt; However, now that I am doing some selects on the table the </div>
<div>&gt; resultset </div>
<div>&gt; &gt; only contains a subset of the table columns</div>
<div>&gt; &gt;</div>
<div>&gt; &gt; I tried doing</div>
<div>&gt; &gt;</div>
<div>&gt; &gt; my $row = $rset-&gt;first;</div>
<div>&gt; &gt; %row = $row-&gt;get_columns;</div>
<div>&gt; </div>
<div>&gt; my @cols = grep { exists $row{$_} } $rset-&gt;result_source-&gt;columns;</div>
<div>&gt; </div>
<div>&gt; or, really, if you're supplying a subset of columns, just </div>
<div>&gt; hang onto the array you supplied for that.</div>
<div>&gt; </div>
<div>&gt; &gt; my @cols = keys %row;</div>
<div>&gt; &gt;</div>
<div>&gt; &gt; But now I dont have them in the correct order.</div>
<div>&gt; &gt;</div>
<div>&gt; &gt; Is there anyway to get an (ordered)&nbsp; list of the column </div>
<div>&gt; names from the </div>
<div>&gt; &gt; $resultset or the $row</div>
<div>&gt; </div>
<div>&gt; --</div>
<div>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Matt S Trout&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Need help with your Catalyst or </div>
<div>&gt; DBIx::Class project?</div>
<div>&gt;&nbsp;&nbsp;&nbsp; Technical Director&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </div>
<div>&gt; <a href="http://www.shadowcat.co.uk/catalyst/"><font color="#0000FF"><u>http://www.shadowcat.co.uk/catalyst/</u></font></a></div>
<div>&gt;&nbsp; Shadowcat Systems Ltd.&nbsp; Want a managed development or </div>
<div>&gt; deployment platform?</div>
<div>&gt; <a href="http://chainsawblues.vox.com/"><font color="#0000FF"><u>http://chainsawblues.vox.com/</u></font></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </div>
<div>&gt; <a href="http://www.shadowcat.co.uk/servers/"><font color="#0000FF"><u>http://www.shadowcat.co.uk/servers/</u></font></a></div>
<div>&gt; </div>
<div>&gt; _______________________________________________</div>
<div>&gt; List: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class"><font color="#0000FF"><u>http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class</u></font></a></div>
<div>&gt; IRC: irc.perl.org#dbix-class</div>
<div>&gt; SVN: <a href="http://dev.catalyst.perl.org/repos/bast/DBIx-Class/"><font color="#0000FF"><u>http://dev.catalyst.perl.org/repos/bast/DBIx-Class/</u></font></a></div>
<div>&gt; Searchable Archive: </div>
<div>&gt; <a href="http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk"><font color="#0000FF"><u>http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk</u></font></a></div>
<div>&gt; </div>
<div>&nbsp;</div>
</font>
</DIV>
<DIV>
<HR>
</DIV>
<P CLASS="BulletedList" STYLE="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0in; mso-list: none; tab-stops: .5in"><SPAN STYLE="FONT-SIZE: 8pt; COLOR: gray; mso-bidi-font-family: Arial"><FONT FACE="Arial" COLOR="gray" SIZE="1">NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.</FONT></SPAN></P>
<DIV>
</DIV></BODY></HTML>