in reply to Re^3: extract column data
in thread extract column data
selectall_arrayref seems to work but am getting
ARRAY<0x1c56ba4>my $sth = $dbh->selectall_arrayref("SELECT lastname FROM dbase");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: extract column data
by thanos1983 (Parson) on May 24, 2017 at 14:57 UTC | |
Hello bigup401, The output is correct. See bellow:
You can read a bit more at perlref. Hope this helps.
Seeking for Perl wisdom...on the process of learning...not there...yet!
| [reply] [d/l] |
by bigup401 (Pilgrim) on May 24, 2017 at 15:58 UTC | |
thanks, am now getting all lastnames printed but comes in array format with comma, single quots brackets and am not good in regex to remove [', and make it well printed like
any idea
| [reply] [d/l] [select] |
by Mr. Muskrat (Canon) on May 24, 2017 at 17:08 UTC | |
You can't just cobble together various examples and hope to make it work. You need to read the documentation and understand what you are working with. Start by reading the documentation for DBI related to selectall_arrayref as others have already instructed. Then read the documentation for Perl references.
| [reply] |
by thanos1983 (Parson) on May 24, 2017 at 18:57 UTC | |
Hello again bigup401, I found some time and I put together a small example that replicates your script and also the test case.
The conf.ini file:
On your next question it would be easier for us to provide your minimal working example for replicating your problem. Hope this helps.
Seeking for Perl wisdom...on the process of learning...not there...yet!
| [reply] [d/l] [select] |
| |