[freetds] Different Data?

Vendetti, Jeff Jeff.Vendetti at FMR.COM
Tue Oct 14 12:47:59 EDT 2003


Sure, here's the perl program:

#!/usr/local/bin/perl
use strict;
use DBI;
my ($dbh, $rc, $sth, @tablesViews);
$dbh = DBI->connect("dbi:Sybase:server=CSL_Central",'fish','fish',
        {PrintError => 0});
die "Unable to connect to server $DBI::errstr" unless $dbh;
@tablesViews = qw(
        CSLCorePageVolume
        CSLPageVolume
        CSLPracticeUserVolume
        CSLRealmUserVolume
);
foreach (@tablesViews)
{
        print "Count for $_: ";
        my @dat;
        $sth = $dbh->prepare("select count(*) from $_");
        if ($sth->execute())
        {
                while (@dat = $sth->fetchrow())
                {
                        print "@dat\n";
                }
        }
        else
        {
                print "No Rows\n";
        }
        $sth->finish();
}
$dbh->disconnect();

And here's the tsql session:

1> 
2> select count(*) from CSLCorePageVolume
3> go
2486    

The MSQuery returns 5385 rows.

Jeff


More information about the FreeTDS mailing list