ccn has asked for the wisdom of the Perl Monks concerning the following question:

Does anybody know how to get a list of processes of Sybase ASE with a perl script?

I'd like to enumerate Sybase processes like Sybase Central does. I know there is a sp_who stored procedures exists and it does almost what I want, but it does'nt show names of programs connected to a server.

So the question is: How to get a name of program which making query at this moment?

Thanks,
ccn

Replies are listed 'Best First'.
Re: Sybase process view
by VSarkiss (Monsignor) on Aug 06, 2004 at 22:42 UTC

    Perl isn't relevant to this.

    The data is in the program_name column of master..sysprocesses, which is indexed by spid, and the spid of the executing process is in @@spid IIRC. Take a look at how sp_who works, and add the column to the relevant query. You can get the text with:

    use sybsystemprocs sp_helptext sp_who