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 MBAY dot NET>
Subject: Re: ct_callback from perl
Date: Mar 5 1998 12:11AM

Todd Cooper wrote:
> I hope you can help :-)
> I am having problems calling ct_callback from sybperl.  Do you have
> any examples?  My problem may stem from the fact that I am calling
> from my own library.  No way of passing the function seems to work.  I
> looked at the test library in the distribution and it was not much
> help.
> The snippet of code I am using is:
>             $self->log("before setting callbacks retval=$retval error=$!");
>             $retval = $self->{'db_connection'}->ct_callback(CS_CLIENTMSG_CB, \&msg_cb);

ct_callback() is not a function that should be called with a database
handle. It's purpose is to install a callback which will be called
when an error occurs, on any database connection.

So the correct syntax would be:

Sybase::CTlib::ct_callback(CS_CLIENTMSG_CB, \&msg_cb);

> How does the literal "srv_cb" actually work?  Does it look up a global
> function with that name?

Yes. So you're really better off by using \&srv_cb.

Michael Peppler         -||-  Data Migrations Inc.    -||-
Int. Sybase User Group  -||-