http://qs1969.pair.com?node_id=592925

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

I am trying to search in net how to use 'in' clause that we use in the sql select query. I need to use a similar thing using DBIx::Class.

I was trying this

my $obj1 = $schema->resultset('table1')->search( { id => { -in =>[1238772, 1071473] } });

Replies are listed 'Best First'.
Re: using in DBIx::Class
by phaylon (Curate) on Jan 04, 2007 at 12:25 UTC
    Don't search "the net," just read DBIC's CPAN documentation. For example, in http://search.cpan.org/dist/DBIx-Class/lib/DBIx/Class/Manual/Intro.pod is an example that uses "IN".

    Update: Also, is your resultset really named "table1"? Where have you got that code from that you're trying? What is the error?


    Ordinary morality is for ordinary people. -- Aleister Crowley
Re: using in DBIx::Class
by tinita (Parson) on Jan 04, 2007 at 12:24 UTC
    do you get an error message? this code works for me...