# Select the complete dataset from the table and ready it for print out to the work directory my $allrows = $dbh->selectall_arrayref("SELECT DISTINCT $col FROM STUDENTREC WHERE PARTITION_KEY = '$partition_key' $extra $group") or die("Could not get data from table ".DBI->errstr);