Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Re: Class::DBI and sql order by

by Anarion (Hermit)
on Nov 16, 2003 at 11:25 UTC ( [id://307454]=note: print w/replies, xml ) Need Help??


in reply to Re: Class::DBI and sql order by
in thread Class::DBI and sql order by

I would do something like this:
__PACKAGE__->set_sql(regions_sorted => qq{ SELECT customer.id, customer.name, region.name FROM customer INNER JOIN region ON customer.region = region.id ORDER BY region.name DESC }); sub retrieve_sorted_by_region { my $class = shift; my $sth = $class->sql_regions_sorted; $sth->execute or carp "Error: $DBI::errstr"; return $class->sth_to_objects($sth); }

$anarion=\$anarion;

s==q^QBY_^=,$_^=$[x7,print

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-18 09:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found