0

I am converting a perl script from DBlib to DBI for sybase connections. I am Implementing kerberos. what is the function of the fourth argument (the name of the perl script) in the DBLib connection and equivalent in DBI? eg. DBLib Connection:

$dbh     = new Sybase::DBlib $USER, $PASS, $SRV, "file.pl";

This is equal to -

$dsn = "dbi:sybase:server=$SRV;kerberos=$kerbprincipal;scriptName=file.pl";    
$dbh = DBI->connect($dsn,"","");

I found following about the DBI scriptName from cpan.org.

scriptName

Specify the name for this connection that will be displayed in sp_who (ie in the sysprocesses table in the program_name column).


Answer: The fourth argument in dblib and scriptName in dbi sets the program_name column in sysprocess table. this can be used in logs and monitoring the database.

Alfabravo
  • 7,493
  • 6
  • 46
  • 82
Mohit
  • 2,239
  • 19
  • 30

1 Answers1

1

I believe the AppName connection string attribute in MS SQL Server basically ends up in the sysprocesses table (and hence sp_who) and SQL Server started its life as Sybase. I think $appname in Sybase::DBlib is equivalent to ScriptName in DBD::Sybase. I cannot prove it now as I no longer have Sybase.

bohica
  • 5,932
  • 3
  • 23
  • 28
  • Thanks for the response bohica. Sybase also have sysprocesses table. I tested it today with sybase. I was able to query sysprocesses table. And it works. Modifying my question now. – Mohit Nov 24 '11 at 19:03
  • Note that the scriptName string must not be longer than 15 chars or so, the rest will be truncated. (Maybe this has changed in the very newest releases of Sybase ASE?) – knb Nov 24 '11 at 22:17
  • Thanks Knb. That was a usefull info. – Mohit Nov 25 '11 at 18:51