[Dbix-class] search any matching word in given string in table column which has only one word

Rajeev Prasad rp.neuli at yahoo.com
Sat Aug 11 17:24:30 GMT 2012


thanks a lot that worked!




________________________________
 From: Rodrigo <rodrigolive at gmail.com>
To: Rajeev Prasad <rp.neuli at yahoo.com>; DBIx::Class user and developer list=
 <dbix-class at lists.scsys.co.uk> =

Cc: mysql list <mysql at lists.mysql.com> =

Sent: Saturday, August 11, 2012 11:12 AM
Subject: Re: [Dbix-class] search any matching word in given string in table=
 column which has only one word
 =


Maybe something like this will do:

my $str =3D 'as23,rt54,yh79';
>$schema->resultset('MyTable')
>=A0 =A0->search({ id=3D>[ split /,/ =3D> $str ] });

regards,
rodrigo


On Sat, Aug 11, 2012 at 6:05 PM, Rajeev Prasad <rp.neuli at yahoo.com> wrote:

here is given string of type:...=A0=A0 "as23,rt54,yh79"
>and i have to lookup in a table which has column "id" which has only one f=
our letter word. i have to select that row in which the colum 'id' value ma=
tches any of the word in given string... =

>
>table column: id
>contents like:
>| id|
>----
>|sd32|
>|wa32|
>|rt54|
>
>
>after that match row with id=3D'rt54' should be returned.
>
>
>i am not able to figure the sql statement for this? eventually i want to h=
ave DBIx statement to use in my perl code. So either suggestion will work f=
or me.
>
>
>ty.Rajeev
>
>_______________________________________________
>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.c=
o.uk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20120811/b65=
119e3/attachment-0001.htm


More information about the DBIx-Class mailing list