Grokbase
Topics Posts Groups | in
x
[ help ]

[Dbix-class] single field in resultset?

View PostFlat  Thread  Threaded | < Prev - Next >
Mark Blythe [Dbix-class] single field in resultset?
| +1 vote
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
Michael,

See the 'columns' attribute or the 'select / as' attribute combo.  For
example:

$schema->resultset('Foo')->search(
  {  id =3D> { -in =3D> [ 1, 2, 3 ] }  },
  {  columns =3D> [ 'id', 'title' ] }
);

It's covered in more detail in the ATTRIBUTES section of the
DBIx::Class::ResultSet perldocs.  There are also some examples in
DBIx::Class::Manual::Cookbook under 'Using specific columns'.

Good luck,
Mark


On Dec 6, 2007 11:08 AM, Michael Higgins <linux@evolone.org> wrote:

> Can anyone tell me how to grab a result set that is a list of only one
> column? I see how to do %where, but not [what]..??
>
> Cheers,
>
> --
>  |\  /|        |   |          ~ ~
>  | \/ |        |---|          `|` ?
>  |    |ichael  |   |iggins    \^ /
>  michael.higgins[at]evolone[dot]org
>
> _______________________________________________
> 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.rawmode.org
>

Thread : [Dbix-class] single field in resultset?
1)
Michael Higgins Can anyone tell me how to grab a result set that is a list of only one column? I see how to do...
2)
Marc Mims See: http://search.cpan.org/~ash/DBIx-Class-0.08008/lib/DBIx/Class/ResultSetColumn.pm my @values =...
3)
Mark Blythe Michael, See the 'columns' attribute or the 'select / as' attribute combo. For example:...
4)
Michael Higgins Thanks folks! I wound up with this: my $result = [$schema->resultset('DB::DATA')->search( 'Bill To'...
spacer
View PostFlat  Thread  Threaded | < Prev - Next >