anirudh_sml has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks need some information in catalyst
I am making a query like

my @data = $c->model("t1")->search( { "t2.num" => $a, "t3.name" => "xyz" }, { prefetch => [qw/t2 t3/], select => [qw/xyz rst/], #xyz feild is comman in t2 and t3 distinct => [qw/xyz rst/], order_by => [qw/rst/] } )->all;

prefetch fetched all the elements of t2 but I want some selected elements of t2 not all.
Please suggest ....
Thank You

Replies are listed 'Best First'.
Re: Fetching selective elements of table through prefetch
by Anonymous Monk on Jun 24, 2011 at 17:27 UTC

    I can't seem to run your code. Undefined values, and lack of sample data seems to be a problem.

    Also, don't use $a or $b, since those are magical sort variables.

      Thank you for your time !!
      This is a multiselect query we are writing in ctalyst framework . the issue is the prefetch function we are using . This function is a DBIX:class function by default it take all the elements of the table defined in it . I want only selective elements, want to know how ?