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: Sybperl, loops, and unfortunate information retention.
Date: May 17 2000 4:57PM

As follows is a portion of code that I'm attempting to use to gather hourly
statistics for a few of our servers... When I run the script, the Picard
loop executes correctly. However, the elsif for Data and Dax both spit out
sybase error messages which indicate that they are attempting to use
Picard's database names still (Attempt to locate entry in sysdatabases for
database '_______' by name failed - no entry found under that name. Make
sure that
name is entered properly). All of the variables are unique, and I was
wondering if there is something quirky with attempting multiple sybase
sessions within one script?


$SQL="sp_spaceused syslogs";

foreach $server (@servers){

                $X = Sybase::CTlib->ct_connect($uid, $passwd, $server);

                foreach $database_picard (@picard){
                #print $database;
                        $X->ct_sql("use $database_picard");

                        while($X->ct_results($restype) == CS_SUCCEED){
                                next if(!$X->ct_fetchable($restype));
                                        while(@dat_picard = $X->ct_fetch){
                                                @translog_picard =
(@translog_picard, @dat_picard);
                                                #print @translog_picard;
                $Y = Sybase::CTlib->ct_connect($uid, $passwd, $server);

                foreach $database_data (@data){
                        $Y->ct_sql("use $database_data");

                        while($Y->ct_results($restype) == CS_SUCCEED){
                                next if(!$Y->ct_fetchable($restype));
                                        while(@dat_data = $Y->ct_fetch){
                                                @translog_data =
(@translog_data, @dat_data);
                $Z = Sybase::CTlib->ct_connect($uid, $passwd, $server);

                foreach $database_dax (@dax){
                        $Z->ct_sql("use $database_dax");

                        while($Z->ct_results($restype) == CS_SUCCEED){
                                next if(!$Z->ct_fetchable($restype));
                                        while(@dat_dax = $Z->ct_fetch){
                                                @translog_dax =
(@translog_dax, @dat_dax);


Jamie Belanger
System Administrator
Global Crossing
(319) 298-1489 or ext. 489

-----Original Message-----
From: Michael Peppler []
Sent: Friday, April 14, 2000 9:16 AM
To: SybPerl Discussion List
Subject: Re: PHP is breaking Sybase::DBlib

David Hojo Hajoglou writes:
 > So, I was having a hell of a time to get DBlib to work in a module.  The
 > code worked fine as a script, but the database handle was not created
 > properly when with a module.  As I prepared for Harikari, I looked at the
 > loggs and php glared back at me.
 > My compile was:
 > Apache/1.3.12 (Unix) mod_perl/1.22 PHP/3.0.15
 > Change to
 > Apache/1.3.12 (Unix) mod_perl/1.2
 > And the code worked. So, I have discovered an incompatibility of sorts
 > guess what?  I have no idea how to fix it only that I need to have php
 > mod_perl together.  Why me????  AAAGH.

Do you happen to have libdb (berkeley DB) linked in to the first
mod_perl binary? libdb.a and SYbase DBlib both have a dbopen()
function, and that causes some (obvious) problems.

Michael Peppler         -||-  Data Migrations Inc.    -||-
Int. Sybase User Group  -||-
Sybase on Linux mailing list: