|
|
sybperl-l Archive
Up Prev Next
From: Michael Peppler <mpeppler at MBAY dot NET>
Subject: sybperl/ct-lib env setting
Date: Oct 2 1998 5:07PM
Larry Chen writes:
> Hi,
>
> I was trying to set $SYBASE within perl codes. but the "use Sybase::CTlib" statement
> seemed to insist using the $SYBASE from shell. Do you know how to solve the problem?
>
Use a BEGIN{} block:
BEGIN {
$ENV{SYBASE} = ...
}
use Sybase::CTlib;
etc...
Michael
>
> ---
>
> Here is parts of the codes:
>
> #!/home/perl5/bin/perl -w
>
> $ENV{SYBASE}="/afs/lehman.com/environs/sybase/opnclient/SPARC_4.1/10.0.2";
>
> use Sybase::CTlib;
>
> local($dbuser) = 'pntdbadm';
> local($dbpasswd) = 'pntdbadm';
> local($dataserver) = shift(@ARGV);
> local($cmp_proc) = 'remove_instruments.point_a';
> local(@existable) = `grep -i 'delete' $cmp_proc | awk '{print $2}'`;
> #print "@existable\n";
>
> #local($existable) = 'test';
>
> # allocate a new database handle
> $dbh = new Sybase::CTlib $dbuser,$dbpasswd,$dataserver;
>
> ---
>
> Here is the error msg:
>
> 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 /usr/local/sybase. Check the environment variable SYBASE if it is not the one you want!
> Cannot access file /usr/local/sybase/locales/locales.dat
> Sybase::CTlib initialize: cs_ctx_alloc() failed at /home/perl5.new/lib/DynaLoader.pm line 153.
>
>
--
Michael Peppler -||- Data Migrations Inc.
mpeppler@mbay.net -||- http://www.mbay.net/~mpeppler
Int. Sybase User Group -||- http://www.isug.com
|