PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: "Huang, Christa (GOS, ETS)" <CHuang at exchange dot ml dot com>
Subject: DBCC PSS output redirection to file - problem
Date: Sep 28 1999 6:55PM

All, 
I am executing a very simple script which does dbcc pss for a particular
spid. For some reason, I cannot redirect it to a file. Here is part of the
script. Any help would be appreciated.
Thanks in advance
Christa

$db = "RSSD";
$logfile = "/tmp/$db.dbcc";

open(LOG, ">$logfile") || die "Can't open log file $logfile: $!\n";

$mycmd="use $db
dbcc traceon(3604)
dbcc pss(6,7,1)";

&dbexec("$mycmd");

close(LOG);

sub dbexec {
    my($cmd) = @_;
    my(@dat, $ret);

    $dbh->ct_execute($cmd);
    $dbh->ct_results($ret);
    while($dbh->ct_results($ret) == CS_SUCCEED) {
        next unless $dbh->ct_fetchable($ret);
        while(@dat = $dbh->ct_fetch) {
            printf(LOG "@dat\n");
        }
    }
}