|
|
sybperl-l Archive
Up Prev Next
From: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: Using different interfaces file
Date: Oct 10 2001 3:08PM
Rakesh Dinger writes:
> Hi gurus,
>
> Is it possible to specify a different interfaces file when setting up a
> connection in Sybperl, rather than use the default one of $SYBASE/interfaces
> (something similar to the -I option in isql)???
>
> I can do this in DBI, but I need a solution in Sybperl.
For DBlib it's dbsetifile(), which you need to call before you call
new()/dblogin().
For CTlib it's ct_config(), and setting the interface is even the
example in the manual:
$ret = ct_config($action, $property, $value, $type)
Calls ct_config() to change some basic parameter,
like the interfaces file location.
$action can be CS_SET or CS_GET.
$property is one of the properties that is set-
table via ct_config() (see your OpenClient man
page on ct_config() for a complete list).
$value is the input value if $action is CS_SET,
and the output value if $action is CS_GET.
$type is the data type of the property that is
being set or retrieved. It defaults to
CS_CHAR_TYPE, but should be set to CS_INT_TYPE if
an integer value (such as CS_NETIO) is being set
or retrieved.
$ret is the return status of the ct_config() call.
Example:
$ret = ct_config(CS_SET, CS_IFILE, "/home/mpeppler/foo", CS_CHAR_TYPE);
print "$ret\n";
$ret = ct_config(CS_GET, CS_IFILE, $out, CS_CHAR_TYPE);
print "$ret - $out\n"; #prints 1 - /home/mpeppler/foo
Michael
--
Michael Peppler - Data Migrations Inc. - http://www.mbay.net/~mpeppler
mpeppler@peppler.org - mpeppler@mbay.net
International Sybase User Group - http://www.isug.com
|