Support for DSN style connection properties

The driver uses a DSN mechanism that allows certain attributes to be set at connection time.

The DSN attribute syntax is the same as the Open Source DBD::Sybase driver. Therefore, you need not change Perl scripts or maintain different versions for DBD::Sybase versus DBD::SybaseASE. However, DBD::SybaseASE does not support some attributes that are considered obsolete. See “Currently unsupported DSN syntax”.


SybaseASE driver connect syntax

DBI->connect("dbi:SybaseASE:attr=value;attr=value", $user_id, $password, %attrib);

The dbi:SybaseASE: section obtains the package name of the driver so it can be loaded. When the DSN is passed into the driver, the system removes this part and the remaining string holds the key and value pairs to be dissected.

NoteThe $user_id and $password credentials are separate API arguments; they are not part of the DSN string.

The %attrib argument is an optional, comma-separated chain of key-value pairs that set options at connection time. They are passed into the driver and handled during a connect() call. For example:

DBI->connect("dbi:SybaseASE:server=mumbles; user, password,	PrintError => 1, AutoCommit = 0);

Attributes and methods

These attributes are currently supported when connecting to a server:

You can repeat attribute values as long as they are recognized by the driver. Illegal attributes cause the DBI->connect() call to fail.

NoteThe attribute names follow the Open Source Sybase Perl driver.

DSN-specific example:

$dbh = DBI->connect("dbi:SybaseASE:server=mumbles", $user, $passwd);

Alternatively, use the DSQUERY environment variable:

my $srv = $ENV{"DSQUERY"};$dbh = DBI->connect("dbi:SybaseASE:server=$srv",  $user, $passwd);
$dbh = DBI->connect("dbi:SybaseASE:host=tzedek.sybase.com;port=8100", $user, $passwd);
$dbh = DBI->connect("dbi:SybaseASE:maxConnect=100", $user, $passwd);
$dbh = DBI->connect("dbi:SybaseASE:database=sybsystemprocs", $user, $passwd);
$dbh = DBI->connect("dbi:SybaseASE:charset=iso_1", $user, $passwd);
$dbh = DBI->connect("dbi:SybaseASE:language=us_english", $user, $passwd);
$dbh = DBI->connect("dbi:SybaseASE:packetSize=8192", $user, $passwd);
$dbh = DBI->connect("dbi:SybaseASE:interfaces=/opt/sybase/interfaces", $user, $passwd);
$dbh = DBI->connect("dbi:SybaseASE:loginTimeout=240", $user, $passwd);
$dbh = DBI->connect("dbi:SybaseASE:timeout=240", $user, $passwd);
$dbh = DBI->connect("dbi:Sybase:scriptName=myScript", $user, $password);
$dbh = DBI->connect("dbi:SybaseASE:hostname=pedigree", $user, $password);
$dbh = DBI->connect("dbi:SybaseASE:encryptPassword=1", $user, $password);
$dbh = DBI>connect("dbi:SybaseASE:sslCAFile=/usr/local/sybase/trusted.txt", $user, $password,  
AutoCommit => 1);

DSN-specific example combination:

$dbh = DBI->connect("dbi:SybaseASE:server=mumbles, database=tempdb;packetSize=8192;
language=us_english;charset=iso_1;encryptPassword=1", $user, $pwd, AutoCommit=>1, PrintError => 0);

Currently unsupported DSN syntax