USERENV干什么的??是个函数吗??

解决方案 »

  1.   

    SQL> SELECT USERENV('SESSIONID') SID,USERENV('TERMINAL') TERM FROM DUAL;       SID TERM
    ---------- --------------------------------
         74188 AAAASESSIONID : 当前session的ID号;
    TERMINAL : 客户端的机器名;
      

  2.   

    USERENV是什么东西呀??session是什么东西??
      

  3.   

    SQL> select SYS_CONTEXT('USERENV','SESSIONID') sessionid,SYS_CONTEXT('USERENV','TERMINAL') terminal from dual;SESSIONID                                                                        TERMINAL
    -------------------------------------------------------------------------------- --------------------------------------------------------------------------------
    464                                                                              FANGCUN当前会话号与本地机械名
      

  4.   

    1)USERENV是什么东西呀?? :
      oracle 的函数。
       USERENV SYNTAX:     USERENV(option) PURPOSE:     Returns information of VARCHAR2 datatype about the current session. 
        This information can be useful for writing an application-specific 
        audit trail table or for determining the language-specific 
        characters currently used by your session.  You cannot use this 
        function in the condition of a CHECK constraint.  The argument     option can have any of these values:             'ENTRYID' 
                       returns available auditing entry identifier.  You 
                       cannot use this option in distributed SQL statements. 
                'LABEL' 
                       returns your current session label.  This option is 
                       only applicable for Trusted Oracle. 
                'LANGUAGE' 
                       returns the language and territory currently used by                    your session along with the database character set in 
                       this form:                    language_territory.characterset             'SESSIONID' 
                       returns your auditing session identifier.  You cannot 
                       use this option in distributed SQL statements. 
                'TERMINAL' 
                       returns the operating system identifier for your                    current session's terminal.  In distributed SQL 
                       statements, this option returns the identifier for 
                       your local session. EXAMPLE:     SELECT USERENV('LANGUAGE') "Language" 
            FROM DUAL;     Language 
        -------------------------- 
        AMERICAN_AMERICA.US7ASCII 
      

  5.   

    USERENV 
    语法:userenv(option)
    Purpose
    USERENV returns information of VARCHAR2 datatype about the current session. This information can be useful for writing an application-specific audit trail table or for determining the language-specific characters currently used by your session. You cannot use USERENV in the condition of a CHECK constraint. 
    option:
    'SESSIONID' 
     SESSIONID returns your auditing session identifier. You cannot use this option in distributed SQL statements. 
     
    'TERMINAL' 
     TERMINAL returns the operating system identifier for your current session's terminal. In distributed SQL statements, this option returns the identifier for your local session. In a distributed environment, this is supported only for remote SELECT statements, not for remote INSERT, UPDATE, or DELETE operations. 
     
      

  6.   

    session,就是会话,或者说就是一个连接,客户端到服务段的一个连接就是一个sessiondual是一个虚表
      

  7.   

    有没有session的详细解释???它是干什么用的???