|
pssinfo()
The
system function
pssinfo() was introduced out of the requirement to
be able to display
IPv6
IP addresses
with a length of 64
bytes
in total. In
ASE
an IP address is normally stored in the
system table
sysprocesses.
But this
table
would have to be enlarged in order to store the larger IPv6 format.
As this was not possible, the function
pssinfo was introduced to retrieve the IP address from
internal memory structures.
The function pssinfo() is available in
ASE
starting with version 12.5.4.
Syntax of the System Function pssinfo()
pssinfo(spid | 0, 'option')
The parameters of the System Function pssinfo()
"spid"
The parameter "spid" is the process ID of the
session,
on which information is needed.
The "spid" can be determined using the
stored procedure
"sp_who",
or by reading its value from the
column
spid of the
system table
sysprocesses.
By specifiying a value of "0" instead of the process ID
as parameter for the function, as default, the "spid"
of the current session is taken.
"option"
The parameter "option" of the function pssinfo()
contains as value a field of the memory based
PSS
structur, i.e. an internal administrative structure for
running processes.
Possible values for this parameter are:
-
ipaddr - The Internet Protocol (IP) address of the client
-
extusername - Returns the name of the external
user
from
PAM
or
LDAP,
when using
external authentication.
-
dn - When using LDAP authetication, the return value
corresponds to the "Distinguished Name".
Example for the System Function pssinfo()
select pssinfo(0,"ipaddr")
go
---------------------
140.13.64.52
Returns the IP address of the current session, in this case
"140.13.64.52".
See also:
ASE T-SQL - Aggregate Functions, audit_event_name(), col_length(), col_name(), curunreservedpgs(), datachange(), datalength(), data_pages(), data_pgs(), db_id(), db_name(), host_id(), host_name(), identity(), index_col(), index_colorder(), isnull(), lct_admin(), license_enabled(), lockscheme(), next_identity(), object_id(), object_name(), pagesize(), pointer_size(), ptn_data_pgs(), reserved_pages(), reserved_pgs(), rowcnt(), row_count(), showplan_in_xml(), syb_sendmsg(), syb_sendmsg(), System Functions, tempdb_id(), tran_dumpable_status(), tsequal(), used_pages(), used_pgs().
|