Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

using in DBIx::Class

by palette (Scribe)
on Jan 04, 2007 at 11:32 UTC ( [id://592925]=perlquestion: print w/replies, xml ) Need Help??

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...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://592925]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2024-04-25 06:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found