SYS_CONTEXT(c1,c2)
返回系统 c1 对应的 c2 的值。可以使用在 SQL/PLSQL 中,但不可以用在并行查询或者 RAC 环境中。
c1 'USERENV'
c2 参数表,详见示例
字符串
select SYS_CONTEXT('USERENV','TERMINAL') terminal from dual; select SYS_CONTEXT('USERENV','LANGUAGE') language from dual; select SYS_CONTEXT('USERENV','SESSIONID') sessionid from dual; select SYS_CONTEXT('USERENV','INSTANCE') instance from dual; select SYS_CONTEXT('USERENV','ENTRYID') entryid from dual; select SYS_CONTEXT('USERENV','ISDBA') isdba from dual; select SYS_CONTEXT('USERENV','NLS_TERRITORY') nls_territory from dual; select SYS_CONTEXT('USERENV','NLS_CURRENCY') nls_currency from dual; select SYS_CONTEXT('USERENV','NLS_CALENDAR') nls_calendar from dual; select SYS_CONTEXT('USERENV','NLS_DATE_FORMAT') nls_date_format from dual; select SYS_CONTEXT('USERENV','NLS_DATE_LANGUAGE') nls_date_language from dual; select SYS_CONTEXT('USERENV','NLS_SORT') nls_sort from dual; select SYS_CONTEXT('USERENV','CURRENT_USER') current_user from dual; select SYS_CONTEXT('USERENV','CURRENT_USERID') current_userid from dual; select SYS_CONTEXT('USERENV','SESSION_USER') session_user from dual; select SYS_CONTEXT('USERENV','SESSION_USERID') session_userid from dual; select SYS_CONTEXT('USERENV','PROXY_USER') proxy_user from dual; select SYS_CONTEXT('USERENV','PROXY_USERID') proxy_userid from dual; select SYS_CONTEXT('USERENV','DB_DOMAIN') db_domain from dual; select SYS_CONTEXT('USERENV','DB_NAME') db_name from dual; select SYS_CONTEXT('USERENV','HOST') host from dual; select SYS_CONTEXT('USERENV','OS_USER') os_user from dual; select SYS_CONTEXT('USERENV','EXTERNAL_NAME') external_name from dual; select SYS_CONTEXT('USERENV','IP_ADDRESS') ip_address from dual; select SYS_CONTEXT('USERENV','NETWORK_PROTOCOL') network_protocol from dual; select SYS_CONTEXT('USERENV','BG_JOB_ID') bg_job_id from dual; select SYS_CONTEXT('USERENV','FG_JOB_ID') fg_job_id from dual; select SYS_CONTEXT('USERENV','AUTHENTICATION_TYPE') authentication_type from dual; select SYS_CONTEXT('USERENV','AUTHENTICATION_DATA') authentication_data from dual;