sys_session system application context

The sys_session context shows the default predefined application context, which provides session-specific pairs of attributes and values. The syntax for using the context is:

select list_appcontext ("sys_session", "*")

Then:

select get_appcontext ("sys_session", "<attribute>")
Table 12-5: sys_session attributes and values

Attribute

Value

username

Login name

hostname

Host name from which the client has connected

applname

Name of the application as set by the client

suserid

User ID of the user in the current database

groupid

Group ID of the user in the current database

dbid

ID of the user’s current database

dbname

Current database

spid

Server process ID

proxy_suserid

The server user ID of the proxy

clientname

Client name set by the middle-tier application, using the set clientname command

clientapplname

Client application name set by the middle-tier application, using the set clientapplname command

clienthostname

Client host name set by the middle-tier application, using the set clienthostname command

language

Current language the client is using by default or after using the set language command (@@language)

character_set

Character set the client is using (@@client_csname)

dateformat

Date expected by the client, set using the set dateformat command

is_showplan_on

Returns YES if set showplan is on, NO if it is off

is_noexec_on

Returns YES if set no exec is on, NO if it is off