Thank you all,<br> it works.<br><br><b><i>Matt Lawrence <matt.lawrence@ymogen.net></i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> Will Smith wrote:<br>> Hi, I know this is not the room for DBIx, I tried to post in DBIx, but<br>> did not go through, so, if you don't mind, please do not bounce me out.<br>> my question is:<br>> I have a multiple join, and trying to sort the dataset using oder_by,<br>> and get either error, or do not sort.<br>> my code is:<br>> # table: calls,property,city . property has many calls, city has<br>> many property, calls belong to property, property belong to city<br>> my $rs = [$c->model('myappDB::City')->search(<br>> {<br>> 'calls.CallerID' => '1',<br>> 'calls.CallStatusID' => '0'<br>> },<br>> {<br>> order_by => 'city.CityName'<br>> },<br>>
{<br>> join => { 'property' => 'calls'<br>> }<br>> }<br>> )];<br>><br>> How can I sort by CityName ?<br>><br>> Thank you.<br>Looks like you have too many hashrefs there, and the city table is<br>called "me" because it's the main table you're searching in.<br><br>Try it like this:<br><br> my $rs = [$c->model('myappDB::City')->search(<br> {<br> 'calls.CallerID' => '1',<br> 'calls.CallStatusID' => '0'<br> },<br> {<br> order_by => 'me.CityName',<br> join => { 'property' => 'calls' },<br> }<br> )];<br><br><br><br>Matt<br><br>_______________________________________________<br>List: Catalyst@lists.rawmode.org<br>Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst<br>Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/<br>Dev site: http://dev.catalyst.perl.org/<br></blockquote><br><p> 
<hr size=1>Be a better Heartthrob. <a href="http://us.rd.yahoo.com/evt=48255/*http://answers.yahoo.com/dir/_ylc=X3oDMTI5MGx2aThyBF9TAzIxMTU1MDAzNTIEX3MDMzk2NTQ1MTAzBHNlYwNCQUJwaWxsYXJfTklfMzYwBHNsawNQcm9kdWN0X3F1ZXN0aW9uX3BhZ2U-?link=list&sid=396545433">Get better relationship answers </a>from someone who knows.<br>Yahoo! Answers - Check it out.