Search for specific field rather than primary key

[prev] [thread] [next] [Date index for 2004/08/12]

From: Kevin Old
Subject: Search for specific field rather than primary key
Date: 19:11 on 12 Aug 2004
Hello everyone,

I'm just curious if the code below that looks in the
Pilot::StoreBrandXref table for a particular store, and has an
iterator created in order to get to the brandid field.

my $bds = Pilot::StoreBrandXref->search({store => $store});

while (my $k = $bds->next) {
        push @{$form_data{brand}}, $k->brandid;
}
print join(",", @{$form_data{brand}}), "<br>";

If I were to say:

my @bds = Pilot::StoreBrandXref->search({store => $store});

the bds array would be an array of the primary keys with store
matching my search.

Is there not a way for me to specify the field I'd like returned
rather than having to create an iterator to get to the field I'd like
to?

Any help is appreciated,
Kevin
        -- 
        Kevin Old
kevinold@xxxxx.xxx

(message missing)

Search for specific field rather than primary key
Kevin Old 19:11 on 12 Aug 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52