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: "Damodharan, Venkat (VDamodharan)" <Venkat dot Damodharan at dresdnerrcm dot com>
Subject: RE: Closing the connection using CT Lib.
Date: Jan 27 1999 12:22AM

Thank you very much.

-----Original Message-----
From: Michael Peppler [mailto:mpeppler@mbay.net]
Sent: Tuesday, January 26, 1999 4:09 PM
To: SybPerl Discussion List
Subject: re: Closing the connection using CT Lib.


>>>>> "Venkat" == VDamodharan   writes:

Venkat> Hello Guru's I am new to the Sybase Perl utilities.  I have
Venkat> written a SybPerl program to open a connection, do DML.
Venkat> Before exiting, I need to close the connection.  I am using CT
Venkat> Lib's.

The connection is automatically closed when the script exits.

The connection is closed when the $dbh goes out of scope, or is
undefined.

You can do something like this:

$dbh = new Sybase::CTlib ...;
...
$dbh = undef;    # This closed the connection.

Or use 'my' variables in a scope:

sub foo {
   my $dbh = new Sybase::CTlib ...;

   ...
}

When control exits the 'foo' subroutine the $dbh goes out of scope and 
is destroyed - so the connection gets closed.

Michael
-- 
Michael Peppler         -||-  Data Migrations Inc.
mpeppler@mbay.net       -||-  http://www.mbay.net/~mpeppler
Int. Sybase User Group  -||-  http://www.isug.com
Sybase on Linux mailing list: ase-linux-list@isug.com