Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^4: My doubts about using fetchall_arrayref

by hdb (Monsignor)
on Apr 02, 2013 at 14:10 UTC ( #1026696=note: print w/replies, xml ) Need Help??


in reply to Re^3: My doubts about using fetchall_arrayref
in thread My doubts about using fetchall_arrayref

As there is redundant information in the sql statement and the list of columns, you could also do

... my @columns = qw( id account_number date ); my $sql = "select ".join( ",", @columns). " from my_table where id <>'' order by date desc"; my $results = $self->_all_data($sql, \@columns); ...

Replies are listed 'Best First'.
Re^5: My doubts about using fetchall_arrayref
by CountOrlok (Friar) on Apr 02, 2013 at 14:58 UTC
    hdb: see my post below about "the_date". It could be that the query is going to do some reformatting of the columns (convert, concatenation, etc) and so trying to join the @columns into the $sql may not be a good idea.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1026696]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2018-06-24 04:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (126 votes). Check out past polls.

    Notices?