No such thing as a small change | |
PerlMonks |
My doubts about using fetchall_arrayrefby Anonymous Monk |
on Apr 02, 2013 at 13:10 UTC ( [id://1026680]=perlquestion: print w/replies, xml ) | Need Help?? |
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks! In my application I want to have one sub to use just to retrieve all the information I need from my db table. The issue is that I am using fetchall_arrayref. In the first call to this sub I am retrieving all the records so I am passing all the column names I need to the sub, it works fine, but on my second call I don’t need all the columns. My question is, can I pass only the rows I need or if there is a way so fetchall_arrayref will take whatever will be passed by the sql query. Here is the sub with all the rows been queried from the db table.
This first call as example, if I am retrieving all the records by calling all the rows from the table, this works fine. This call, I would only need to retrieve 3 rows, but I would like to still use the same sub _all_data(), thats the issue, cause the _all_data() is expecting all the columns and I only need 3 this time. Thanks for helping!
Back to
Seekers of Perl Wisdom
|
|