hello,
I have this host table, which has all unique records. So i want to get a
specific column value for a specific host. i am doing below, but i think it is
not efficient. is there a better way?
my $hostAdd_rs =
$schema-resultset('Host')-search({host=$host},{select=[qw/addr/]});
while (my
1. Define column host as unique in your Result pm, then you can use
$rs-find({ host = $host })-addr;
2. Use method first()
$hostAdd = $rs-search({host = $host})-get_column('addr')-first;
On Mon, Nov 4, 2013 at 2:29 PM, Rajeev Prasad rp.ne...@yahoo.com wrote:
hello,
I have this host table,
Your code is correct. `search` may return several results, so you must
either iterate over them or assign/do something with all the results,
e.g.
-search(…)-all
returns a list of Host resultrow objects. If you are sure the hosts is
unique and therefore `search` will only find one result, you