MERCADOS FINANCIEROS

jueves, 20 de febrero de 2020

SCHEMA

By default, it is the user you used to log in, and you can query it as below:

$ sqlplus / as sysdba

SQL>
select sys_context('USERENV', 'CURRENT_SCHEMA') from dual;


You can change your current schema in your session however:
 alter session set current_schema=HR;

SQL> select sys_context('USERENV', 'CURRENT_SCHEMA') from dual;

SYS_CONTEXT('USERENV','CURRENT_SCHEMA')
--------------------------------------------------------------------------------
SYS

SQL> alter session set current_schema=HR;

Session altered.

SQL> desc employees;
 Name					   Null?    Type
 ----------------------------------------- -------- ----------------------------
 EMPLOYEE_ID				   NOT NULL NUMBER(6)
 FIRST_NAME					    VARCHAR2(20)
 LAST_NAME				   NOT NULL VARCHAR2(25)
 EMAIL					   NOT NULL VARCHAR2(25)
 PHONE_NUMBER					    VARCHAR2(20)
 HIRE_DATE				   NOT NULL DATE
 JOB_ID 				   NOT NULL VARCHAR2(10)
 SALARY 					    NUMBER(8,2)
 COMMISSION_PCT 				    NUMBER(2,2)
 MANAGER_ID					    NUMBER(6)
 DEPARTMENT_ID					    NUMBER(4)

SQL> 


No hay comentarios: