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: Jason Stajich <jason at chg dot mc dot duke dot edu>
Subject: Re: Sybase::CTlib initialization problem
Date: Feb 2 2000 8:59PM

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/CTlib.pm line 858.
> BEGIN failed--compilation aborted at ./eos.pl 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
BEGIN {
	$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 ]
Sybase::CTlib
     The CT-library module has been written in colaboration with
     Sybase.

     DESCRIPTION


     $dbh = new Sybase::CTlib $user [, $passwd [, $server [,[,$appname, [{attributes}]]]])
             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
jason@chg.mc.duke.edu
(919)684-1806