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: Jamie Belanger <jamie_belanger at globalcrossing dot com>
Subject: RE: Sybase::CTlib initialization problem
Date: Feb 2 2000 9:28PM

Yeah, I figured the order was wrong, but I had changed it just for
experimentation earlier, and when I went to change it back I couldn't
remember, and didn't have something around to compare it to. :) So I do have
the order correctly. uid, psswd, server.

Anyway, putting it in a BEGIN loop doesn't help at all, I still get the same
error messages. I've never used a begin loop to declare my sybase
environment before.

Jamie Belanger
Sys Admin, Global Crossing
(319) 298-1489 or ext. 489 

-----Original Message-----
From: Jason Stajich []
Sent: Wednesday, February 02, 2000 2:59 PM
To: SybPerl Discussion List
Subject: Re: Sybase::CTlib initialization problem

On Wed, 2 Feb 2000, Jamie Belanger wrote:

> I have another question. :) I'm attempting to interface with sybase on
> another of our servers, and am receiving the following errors:
> The context allocation routine failed when it tried to load localization
> files!!
> One or more following problems may caused the failure
> Your sybase home directory is /link/sybase. Check the environment variable
> SYBASE if it is not the one you want!
> Using default locale name: "default"
> Sybase::CTlib initialize: cs_ctx_alloc() failed at
> /link/apps/perl5/lib/site_perl/Sybase/ line 858.
> BEGIN failed--compilation aborted at ./ line 33.
> Following is a portion of the script:
> #!/link/apps/perl5/bin/sybperl
> #
> #Date created:  01-27-00 JLB
> #Last modified:

> $ENV{SYBASE} = "/link/sybase";
should put this in a begin block
	$ENV{SYBASE} = "/link/sybase";
> use Sybase::CTlib;
> #error handling (stolen from those who came before)
> ct_callback(CS_CLIENTMSG_CB, \&msg_cb);
> ct_callback(CS_SERVERMSG_CB, "srv_cb");
> #login variables
> $uid = "sa";
> $passwd=" ";
> $server = "gowron";
> #Connect to sybase server and store connection info in $X
> $X = Sybase::CTlib->ct_connect($uid, $server, $passwd);
                               you've got the order wrong here

[ from mpeppler's perldoc Sybase::CTlib ]
     The CT-library module has been written in colaboration with


     $dbh = new Sybase::CTlib $user [, $passwd [, $server [,[,$appname,
             Establishes a connection to the database engine.
             Initializes and allocates resources for the
             connection, and registers the user name, password,
             target server and application name.

> #Execute SQL statement to use the admin database
> $X->ct_sql("use admin");
> Sybase version 11.03 resides in /link/sybase.
> Jamie Belanger 
> Sys Admin, Global Crossing 
> (319) 298-1489 or ext. 489 

Jason Stajich
Center for Human Genetics
Duke University Medical Center