Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Sybase Perl DBI

by Anonymous Monk
on Oct 18, 2012 at 20:15 UTC ( #999815=note: print w/replies, xml ) Need Help??


in reply to Sybase Perl DBI

Is there a reason you are using Sybase::DBlib instead of the more usual DBI?

DBI has a handy selectcol_arrayref() function which folds a single-column resultset into an array reference.

sub sa_details { my $dbh = ... return $dbh->selectcol_arrayref( qq{SELECT userid FROM user} ); } my $arrayref = sa_details();

(Usually you use DBI with the prepare-execute-fetch combination, though. The select{row,all,col} functions are there just for convenience.)