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: Multiple connections
Date: Dec 4 1997 10:02PM

Sandesh Tattitali wrote:
> Hi all,
>         Let me first explain what I am doing before going on to the problem.
> We have multiple Sybase installations on our Solaris box,one installation for each Sybase server that runs on the box. What I want to do is write a script that will access each server and retrieve some information. The key information for each Sybase server is is a CONFIG file with the format
> # Server Name           Sa Password             $SYBASE         Runfile name

What you need to do is set $ENV{SYBASE} once to a valid directory
where you have all the necessary files (like libraries and
locale files) and then use ct_config() to set the path to the
interfaces file (ct_config(CS_SET, CS_IFILE, $path)).

If you need to set the SYBASE env variable you must do so in a 
BEGIN {} block.

You close the connection when the variable goes out of scope.
You can do this by using blocks ({}) and 'my' variables, 
something like:

    my $dbh = new Sybase::CTlib user, pwd, server;



When control reaches the close curly brace the variable goes
out of scope, and the connection is closed.


PS. Next time please use carriage return every 70 chars or so - it
makes reading the message a lot easier.
Michael Peppler       -||-  Data Migrations Inc.  -||-