[Dbix-class] How to use order_by correctly

Oleg Pronin syber.rus at gmail.com
Thu Apr 26 23:11:15 GMT 2007


hmm... strange... i use 'undef' and its ok.

2007/4/26, Justin Wheeler <dbic at datademons.com>:
>
> $c->model('Schema::MyTable')->search({}, { order_by =3D> 'field' })->all(=
);
>
> Justin
>
> On Thu, 26 Apr 2007, RA Jones wrote:
>
> > Hi all,
> >
> > How to change the order of rows returned from
> > $c->model('Schema::MyTable')->all()?
> >
> > $c->model('Schema::MyTable')->all({order_by =3D> 'field'}) is ignored, =
and
> > $c->model('Schema::MyTable')->search({order_by =3D> 'field'}) generates=
 an
> > error as the order_by phrase gets incorporated into the WHERE clause.
> Putting
> > an undef before the hashref didn't do it either.
> >
> > I'm currently achieving a field sort post-db retrieval using Sort::Key,
> but
> > would like to nail my error for future use. Thanks.
> > --
> > Richard Jones
> > Leeds, UK
> >
> >
> > _______________________________________________
> > List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
> > Wiki: http://dbix-class.shadowcatsystems.co.uk/
> > IRC: irc.perl.org#dbix-class
> > SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
> > Searchable Archive:
> http://www.mail-archive.com/dbix-class@lists.rawmode.org/
> >
>
> _______________________________________________
> List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
> Wiki: http://dbix-class.shadowcatsystems.co.uk/
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
> Searchable Archive:
> http://www.mail-archive.com/dbix-class@lists.rawmode.org/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20070427/79c=
8c7c4/attachment.htm


More information about the Dbix-class mailing list