#!/usr/bin/perl use strict; use warnings; use DBI; #establish the connection my $dbh = DBI->connect('dbi:ODBC:myDSN','username','userpassword') || die "Could not connect to database: $DBI::errstr"; #$dbh->{'LongTruncOk'} = 0; #$dbh->{'LongReadLen'} = 100; # sql query statement my $sql = qq/select location,CompletionStatus from ewNetworkFaults where Type like '%Audio Visual%' and CompletionStatus not like '%Completed%'/; # prepare the query my $sth = $dbh->prepare($sql); #execute the query $sth->execute() || die "SQL Error: $DBI::errstr\n"; my @row; my @table = (); # retrieve the values returned from executing your SQL statement while (my @row = $sth->fetchrow_array()) { push @table,@row; #### This is the place I dont know how to save } use Data::Dumper; print Dumper(\@table);