Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at peppler dot org>
Subject: RE: @@error
Date: Jun 18 2004 2:38PM

On Fri, 2004-06-18 at 16:24, Huber, Robert J (Force 3) wrote:
> Thanks for the helpful response!
> This however takes me to my next problem: the "argument list" for the server
> call back module. When I print out the value of each argument the $srv
> argument (see below) is not set to the server the database handle, $dbh, was
> setup to connect to. The value of $srv is a valid server name in our system.
> I printed out the entire environment hash (%ENV) and nowhere can this value
> be found.

Hmmm - do you have an actual example?

In general the $srv name will come from the server, based on the server
name that has been assigned (with sp_addserver, for example):


use Sybase::CTlib;

sub srv_cb {  
  my ($dbh, $errno, $sev, $state, $line, $srv, $proc, $msg) = @_;

  print "srv = $srv\n";

  return CS_SUCCESS;

ct_callback(CS_SERVERMSG_CB, \&srv_cb);

my $dbh = new Sybase::CTlib 'sa', '', 'test';


prints "srv = troll".


Because the entry for "test" in the local interfaces file points to the
server called "troll":

[22] test.master.1> select @@servername;
(1 row affected)

Does this clear things up a bit?


> -----Original Message-----
> From: []On
> Behalf Of Michael Peppler
> Sent: Thursday, June 17, 2004 1:23 PM
> To: SYBPERL-L mailing list (E-mail)
> Subject: RE: @@error
> =========snip
> sub srv_cb {
>   my ($dbh, $errno, $sev, $state, $line, $srv, $proc, $msg) = @_;
> =========snip
Michael Peppler                              Data Migrations, Inc.             
Sybase T-SQL/OpenClient/OpenServer/C/Perl developer available for short
or long term contract positions -