sys_context()函数用法解析

--sys_context


SYS_CONTEXT('namespace', 'parameter' [, length ])


SYS_CONTEXT returns the value of parameter associated with the context namespace at the current instant. You can use this function in both SQL and PL/SQL statements. SYS_CONTEXT must be executed locally.
The namespace must be a valid SQL identifier. The parameter name can be any string. It is not case sensitive, but it cannot exceed 30 bytes in length.


Oracle provides the following built-in namespaces:


USERENV - Describes the current session. The predefined parameters of namespace USERENV are listed in Table 5-11.


SYS_SESSION_ROLES - Indicates whether a specified role is currently enabled for the session. This namespace is available starting with Oracle Database 11g Release 2 (11.2.0.4).


parameter的值

http://docs.oracle.com/cd/E11882_01/server.112/e41084/functions184.htm#SQLRF06117


EODA@PROD1> select SYS_CONTEXT('USERENV','LANGUAGE') language from dual;

LANGUAGE
----------------------------------------------------------------------------------------------------
AMERICAN_AMERICA.AL32UTF8

EODA@PROD1> select SYS_CONTEXT('USERENV','CURRENT_USER') current_user from dual;

CURRENT_USER
----------------------------------------------------------------------------------------------------
EODA

EODA@PROD1> select sys_context('userenv', 'sid') from dual;

SYS_CONTEXT('USERENV','SID')
----------------------------------------------------------------------------------------------------
50


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值