
use DBI;
$ENV{'ODBCINI'}="/export/cmn/etc/odbc.ini" ;
my($connectString) = "dbi:ODBC:DSN=TESTDB;Database=xxxxx;uid=usrxxxxx;pwd=xxxxx" ;
my($dbh)=DBI->connect( $connectString,$user,$password,{RaiseError =>1, PrintError =>1 }) ;
if ( !defined($dbh) ) {
   die "Connection failed" ;
}
my($sqlStr) ;
$sqlStr = "select emp_id, emp_name, address1, address2 from employee where emp_id = 2
           select emp_id from employee where emp_id = 2" ;
#$sqlStr = "select emp_id from employee where emp_id = 2
#           select emp_id, emp_name, address1, address2 from employee where emp_id = 2" ;

my($dbResult) = $dbh->prepare($sqlStr);
$dbResult->execute;
if ( $dbResult->errstr ){
   die $dbResult->errstr ;
}
my(@aRefResult) = qw() ;
my($cnt);
do {
   while ( $data = $dbResult->fetchrow_arrayref ) {
        $aRefResult[++$#aRefResult] = $data ;
   }
} while ( $dbResult->{odbc_more_results}  ) ;
my($a) ;
#foreach $a ( @aRefResult) {
#  print join("|",@{$a}), "\n" ;
#} 
