[Dbix-class] what is the err in this DBIx select...

Rajeev Prasad rp.neuli at yahoo.com
Tue Apr 16 21:31:47 GMT 2013


hello Will,

thx, that worked. but i am not getting anyother item_type returned. there are many more item_types I would like to get them all, in addition to the two which have condition associated with them.....





________________________________
 From: Will Crawford <billcrawford1970 at gmail.com>
To: Rajeev Prasad <rp.neuli at yahoo.com>; DBIx::Class user and developer list <dbix-class at lists.scsys.co.uk> 
Sent: Tuesday, April 16, 2013 6:32 AM
Subject: Re: [Dbix-class] what is the err in this DBIx select...
 


You need the first arg to search there to be [ ... ] rather than { ... }.




On 15 April 2013 20:47, Rajeev Prasad <rp.neuli at yahoo.com> wrote:

I am meaning to run...
>
>search records where:
>    if item_type='XX'   _then_ item column should contain  '%01par%'  or '%01pqt%'
>    and,
>    if item_type='YY' OR item_type='YZ'    _then_   item column should contain  '%00mxz%'
>    and,
>    for all other item_type no condition (select them)
>
>
>
>and i am using following: but i get error in DBIx: "err in sql syntax..."
>
>so what am i doing arong below?
>
>my @itemListRef = $schema->resultset('Itemlist')->search(
>    {
>        {
>        item_type => 'XX',
>        item => [{ like => '%01par%' },{ like => '%01pqt%' }]
>        },
>        {
>        item_type => [{ like => 'YY' }, { like => 'YZ' } ],
>        item => { like => '%00mxz%' }
>        }
>    },
>    { select   => [qw/item_id item item_alias/] }
>    );
>
>_______________________________________________
>List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
>IRC: irc.perl.org#dbix-class
>SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
>Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk
>



More information about the DBIx-Class mailing list