[Dbix-class] Problem getting data from resultset

Kenneth S Mclane ksmclane at us.ibm.com
Thu Jul 5 17:53:49 GMT 2012


Yes, I can get the data that way, but I have to specify each column by 
name that way and I am trying to get this to be a bit more re-usable. I 
need to be able to use this on many different pages, supplying a function 
that doesn't need to be embedded and custom hard coded for each query. I 
am looking to be able to first, grab the names of the columns so I can 
write the header row, then write the data, save the file and offer it up 
to the browser to be saved. I can't find a way to get a list of the field 
names from the result set, that would work as I could then store them in 
vars and then loop through using the column names to get the values for 
each cell.

Rob Kinyon <rob.kinyon at gmail.com> wrote on 07/05/2012 12:35:42 PM:

> From:
> 
> Rob Kinyon <rob.kinyon at gmail.com>
> 
> To:
> 
> "DBIx::Class user and developer list" <dbix-class at lists.scsys.co.uk>
> 
> Date:
> 
> 07/05/2012 12:39 PM
> 
> Subject:
> 
> Re: [Dbix-class] Problem getting data from resultset
> 
> On Thu, Jul 5, 2012 at 10:21 AM, Kenneth S Mclane <ksmclane at us.ibm.com> 
wrote:
> > Well, I cannot seem to get anything out of the resulset, so I'm 
grasping at
> > whatever I can find. Perhaps you have something constructive to add?
> 
> How are you trying to get stuff out of the resultset? Have you tried:
> foreach my $row ( $rs->all ) {
>     # Do something with $row->col1, $row->col2, etc
> }
> 
> Rob
> 
> _______________________________________________
> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive: 
http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20120705/93b30ef5/attachment.htm


More information about the DBIx-Class mailing list