Oracle PL/SQL/User Previliege/Current User — различия между версиями

Материал из SQL эксперт
Перейти к: навигация, поиск
м (1 версия)
 
(нет различий)

Версия 13:45, 26 мая 2010

Display current user

   
SQL>
SQL>
SQL> show user
USER is "sqle"
SQL>



Get current user

 
SQL>
SQL>
SQL> select user Current_User
  2  from dual
  3  /
CURRENT_USER
------------------------------
sqle
1 row selected.
SQL>
SQL> --



Get current user name

 
SQL> select user from dual;
USER
------------------------------
sqle
SQL>



Use current user name in where clause

 
SQL>
SQL> select object_name, object_type
  2  from all_objects
  3  where owner = user
  4  /
OBJECT_NAME                    OBJECT_TYPE
------------------------------ --------------------
MYTABLE_SESSION                TABLE
DONTCOUNTSP                    FUNCTION
DO_COMMIT                      PROCEDURE
DONE                           TABLE
MY_TO_DATE                     FUNCTION
EXITFUNC
FACTORIAL
EMP_CHANGE_S                   PROCEDURE
LOG_SHUTDOWN                   TRIGGER
ADDRESS                        TYPE
LOG_STARTUP                    TRIGGER
ADDRESS                        TYPE BODY
EMP_PUBLIC_DATA                VIEW
EMP_NAME_CHANGE                TRIGGER
EMP_DEPT_PROCS                 PACKAGE
EMP_DEPT_PROCS                 PACKAGE BODY
DEBUG
ERASE                          PROCEDURE
GETEMPBLDGNAME                 FUNCTION
ASSIGNEMPTOBLDG                PROCEDURE
DEBUG                          PACKAGE
ADD_MON                        FUNCTION
RAISE
ASSERT                         PROCEDURE
MAKE_MYTABLE
WRITE_NAME
HELLO
EMP_CHG                        TYPE
EMP_CHANGES                    TABLE
SYS_C005784                    INDEX
SYS_LOB0000016238C00034$$      LOB
AQ$_EMP_CHANGES_S              TABLE
SYS_C005787                    INDEX
AQ$_EMP_CHANGES_V              EVALUATION CONTEXT
AQ$_EMP_CHANGES_T              TABLE
AQ$EMP_CHANGES_S               VIEW
AQ$_EMP_CHANGES_N              SEQUENCE
SYS_IOT_TOP_16247              INDEX
AQ$_EMP_CHANGES_H              TABLE
EMPLOYEES_LIST                 TYPE
EMPLOYEE_TYPE
VIEW_T                         VIEW
STATE_PACKAGE                  PACKAGE
SHAPE                          TYPE
DEPT_EMP_VIEW                  VIEW
IO_BIFER_DEPT_EMP_VIEW         TRIGGER
DEPARTMENT_10                  VIEW
COMPILE_SCHEMA_TMP_PK          INDEX
GET_NEXT_OBJECT_TO_COMPILE     PROCEDURE
COMPILE_SCHEMA
COMPILE_SCHEMA_TMP             TABLE
PRINT_TABLE                    PROCEDURE
SHOW_SPACE
DEBUG_TIMER
VC2TAB                         TYPE
P                              PROCEDURE
PEOPLE                         PACKAGE
PEOPLE                         PACKAGE BODY
TEMP_EMP                       TABLE
P_ADD_PROD                     PROCEDURE
P_ADD_EMPS
P_ADD_ORDERS
MEASURE_USAGE
SYS_IOT_TOP_15816              INDEX
UPPER_ENAME                    TABLE
SHOW_IOT_SPACE                 PROCEDURE
SYS_IOT_TOP_16249              INDEX
SYS_IOT_OVER_16251             TABLE
AQ$_EMP_CHANGES_G
SYS_IOT_TOP_16251              INDEX
AQ$_EMP_CHANGES_I              TABLE
SYS_IOT_TOP_16254              INDEX
AQ$_EMP_CHANGES_E              QUEUE
AQ$_EMP_CHANGES_F              VIEW
AQ$EMP_CHANGES
EMP_DEPT_CHANGES_R             RULE SET
EMP_DEPT_CHANGES_N
AQ$EMP_CHANGES_R               VIEW
EMP_DEPT_CHANGES               QUEUE
DEPT_AND_EMP                   TABLE
FILE_DUMP                      PROCEDURE
EMP_REG                        TABLE
EMP_TYPE                       TYPE
EMP_TAB_TYPE
EMPS_NT                        TABLE
SYS_C005826                    INDEX
SYS_C005827
SUPER_TYPE                     TYPE
SESS_EVENT                     TABLE
NEW_PERSON                     TYPE
PERSON
NEW_PERSON                     TYPE BODY
LOGON_TRIGGER                  TRIGGER
VIRTUAL_TABLE_TYPE             TYPE
ROWTYPE
ELEMENTTYPE
RESULTTYPE
COMPANY_LISTING                PROCEDURE
PIVOT                          FUNCTION
VIRTUAL_TABLE
REMOVE_CONSTANTS
SQL_AREA_TMP                   TABLE

102 rows selected.
SQL>
SQL>
SQL> --