File: testmulti.pl

package info (click to toggle)
libdbd-odbc-perl 1.13-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 544 kB
  • ctags: 287
  • sloc: perl: 3,395; ansic: 3,236; makefile: 55
file content (28 lines) | stat: -rw-r--r-- 698 bytes parent folder | download | duplicates (3)
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
use DBI;
# $Id: testmulti.pl 93 2004-02-19 19:28:16Z jurl $

#$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}  ) ;