Up Prev Next
From: "Jon Hawkesworth" <j dot hawkesworth at talis dot com>
Subject: sybperl and dbcc
Date: Apr 23 2001 2:57PM
I'm trying to run 'dbcc checktable(syslogs)' via sybperl (to check that
syslogs aren't full before letting users attempt to run a software upgrade
that creates a stack of transactions when it runs). (We're using Syperl
2.10 Sybase::DBlib version 1.46 11/06/98 with Perl 5.005_02 on Solaris 2.5.1
with an 220.127.116.11 dataserver on a different box for development work here. I
appreciate this is something of an antique environment but it is the sandbox
within which I have to play, unfortunately).
I've used this syntax with any number of regular sql queries but for some
reason, when I call the dbcc function, although the command goes away long
enough for me to believe that the command has been run by Sybase, I can't
seem to get it to produce any output:
my ($output) = &sql($d,"dbcc checktable (syslogs)");
does not initialise $output
my $output = &sql($d,"dbcc checktable (syslogs)");
returns '0' - not a lot of use when you are after the number of data pages
and/or percent used.
used and neither
my (@resultarray) = &sql($d,"dbcc checktable (syslogs)");
my @resultarray = &sql($d,"dbcc checktable (syslogs)");
I've tried using &nsql() with similiarly disappointing results.
If anybody has any bright ideas about what I might be doing wrong, or what I
could do to get some results, or who has just plain seen this before, I'd be
very gratefull. I hope what I'm trying to do is actually possible - I
appreciate that called a built-in function like dbcc may need some kind of
special handling. I imagine Sybperl's intention was for it be to used to
access Sybase for data rather than running housekeeping commands.
All the best,
This message has been checked for all known viruses by Star Internet delivered
through the MessageLabs Virus Control Centre. For further information visit
Any views or personal opinions expressed within this email may not be those of Talis Information Ltd.
The content of this email message and any files that may be attached are confidential, and for the usage of the intended recipient only. If you are not the intended recipient, then please return this message to the sender and delete it. Any use of this e-mail by an unauthorised recipient is prohibited.