/usr/share/doc/libdbd-odbc-perl/examples/testmulti.pl is in libdbd-odbc-perl 1.56-1build1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | #!/usr/bin/perl
use DBI;
# $Id$
#$ENV{'ODBCINI'}="/export/cmn/etc/odbc.ini" ;
my($connectString) = "dbi:ODBC:DSN=TESTDB;Database=xxxxxdata;uid=usrxxxxx;pwd=xxxxx" ;
# DBI->trace(9) ;
my($dbh)=DBI->connect() ;
if ( !defined($dbh) ) {
die "Connection failed" ;
}
my($sqlStr) ;
$sqlStr = "select id,name from sysobjects where id=1; select * from sysobjects where id=1; select \@\@rowcount";
my($sth) = $dbh->prepare($sqlStr);
$sth->execute;
if ( $sth->errstr ){
die $sth->errstr ;
}
my(@aRefResult) = qw() ;
my(@data) = qw() ;
my($cnt);
do {
while ( @data = $sth->fetchrow ) {
print join("|",@data), "\n" ;
}
} while ( $sth->{odbc_more_results} ) ;
|