Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^6: My doubts about using fetchall_arrayref

by Anonymous Monk
on Apr 02, 2013 at 15:44 UTC ( #1026717=note: print w/replies, xml ) Need Help??


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

In this case I will use the sample below for SQL queries that require a more complex call, yes I could use this:
my $rs = $sth->fetchall_arrayref({});
... my $sql = "select id, account_number, CONVERT(VARCHAR(10),date,101) a +s date from my_table where id <>'' order by date desc"; my @columns = qw( id account_number box ); my $results = $self->_all_data($sql, \@columns); ...

Replies are listed 'Best First'.
Re^7: My doubts about using fetchall_arrayref
by CountOrlok (Friar) on Apr 02, 2013 at 16:13 UTC
    If you have a more advanced query like this one:
    my $sql = "select id, account_number, CONVERT(VARCHAR(10),date,101) as + date from my_table where id <> '' order by date desc";
    Then you can call the version of _all_data() that I gave above as either:
    my @columns = qw( id account_number date ); my $results = $self->_all_data($sql, \@columns);
    or
    my $results = $self->_all_data($sql);
    They will both get the same result set.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2018-06-23 16:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (125 votes). Check out past polls.

    Notices?