Posted on 2008-11-21 13:27:51-08 by boca
Suggestion for extending select method
Current interface of select method:
$sql->select($table, \@fields, \%where, \@order);
If you could also accept \%fields instead of \@fields, you may generate select statments containing 'AS' keywords (column aliasing), like this:
$sql->select('table', {name=>'user_id', best_result=>'max(result)'});
would generate statement:
SELECT user_id AS name, max(result) AS best_result FROM table;
This would let me save another couple of lines of code.
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.