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: mpeppler at itf dot ch (Michael Peppler)
Subject: Re: Backup server messages
Date: Feb 21 1996 4:32PM

> From: Tom Wilson <73123.1360@compuserve.com>
>
> I'm writing a Sybperl script to handle database dumps, but I can't seem to get
> any messages from the backup server.  In particular, I need to know of any
> messages requiring 'sp_volchanged' intervention.  Here's the code I'm using:
> 
> $dbh->dbcmd("dump database tempdata to dbdump"); 
> $dbh->dbsqlexec;                                 
> while($dbh->dbresults != NO_MORE_RESULTS) {      
>     while(@dat = $dbh->dbnextrow) {              
>         print "@dat\n";                          
>     }                                            
> }                                                

I believe the backup server messages arrive with severity 1. The
default message handler (in lib/sybutil.pl) filters out messages with
severity <= 10 to avoid all the 'Changed database to foo" messages.

You could experiment with the message handler below:

sub message_handler
{
    my ($db, $message, $state, $severity, $text, $server, $procedure, $line)
	= @_;

# Display EVERY message:
    print STDERR ("Sybase message ", $message, ", Severity ", $severity,
	       ", state ", $state);
    print STDERR ("\nServer `", $server, "'") if defined ($server);
    print STDERR ("\nProcedure `", $procedure, "'") if defined ($procedure);
    print STDERR ("\nLine ", $line) if defined ($line);
    print STDERR ("\n    ", $text, "\n\n");

    0;
}

&dbmsghandle(\&message_handler);

Michael