File: moreresults.pl

package info (click to toggle)
libdbd-odbc-perl 1.24-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,012 kB
  • ctags: 398
  • sloc: perl: 6,314; ansic: 4,875; makefile: 29; sql: 8
file content (37 lines) | stat: -rwxr-xr-x 816 bytes parent folder | download | duplicates (2)
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
30
31
32
33
34
35
36
37
#!perl -w
# $Id: moreresults.pl 11680 2008-08-28 08:23:27Z mjevans $

#
# Sorry -- this test is pretty specific to MSSQL Server and Sybase...
#

use DBI;
my (@row);

my $dbh;

$dbh = DBI->connect()
       || die "Can't connect to your $ENV{DBI_DSN} using user: $ENV{DBI_USER} and pass: $ENV{DBI_PASS}\n$DBI::errstr\n";
# ------------------------------------------------------------

my $result_sets = 0;
$| = 1;

my $sth;

$sth = $dbh->prepare("{call sp_spaceused}")
	  or die $dbh->errstr;
$sth->execute
   or die $sth->errstr;

do {
    print join(":", @{$sth->{NAME}}), "\n";
    while ( my $ref = $sth->fetch ) {
	print join(":", @$ref), "\n";
    }
} while ($sth->{odbc_more_results});
    print "(", $sth->rows, " rows affected)\n";
    $sth->finish;

$dbh->disconnect();