|
|
sybperl-l Archive
Up Prev Next
From: "Matthew Dickerson" <mdickers at btm dot co dot uk>
Subject: problem with dbcc and CTlib
Date: May 20 1999 2:56PM
I am attempting to run a couple of dbcc checks though sybperl (using ctlib). Please could you have a glance at the selection of code that I have included. Does it look correct ? Why am I not getting any of the dbcc output printed. If I change the sql to 'sp_who', I get the output.
Any help would be appreciated.
Thanks, Matthew.
.
.
.
$sql_query = "dbcc checkdb ($database) ";
dbexec ($sql_query, $user, $password, $server);
}
#####################################################################
sub dbexec {
my($cmd,$user,$password,$server) = @_;
my(@dat, $ret);
my $dbh= new Sybase::CTlib $user,$password,$server;
$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) {
print "@dat\n";
}
}
}
|