top of page
CerebroSQL

Oracle:

CREATE EDITION

CREATE EDITION edition
[ AS CHILD OF parent_edition ]
;

Example

GRANT CREATE ANY EDITION, DROP ANY EDITION to HR;
ALTER USER hr ENABLE EDITIONS;

CREATE EDITION test_ed;

SELECT SYS_CONTEXT('userenv', 'current_edition_name') FROM DUAL;
SYS_CONTEXT('USERENV','CURRENT_EDITION_NAME')
--------------------------------------------------------------------------------
ORA$BASE
1 row selected.

CREATE EDITIONING VIEW e_view AS
SELECT last_name, first_name, email FROM employees;
View created.

DESCRIBE e_view
Name Null? Type
----------------------------------------- -------- ----------------------------
LAST_NAME NOT NULL VARCHAR2(25)
FIRST_NAME VARCHAR2(20)
EMAIL NOT NULL VARCHAR2(25)

ALTER SESSION SET EDITION = TEST_ED;
Session altered.

CREATE OR REPLACE EDITIONING VIEW e_view AS
SELECT last_name, first_name, email, salary FROM employees;

View created.

DESCRIBE e_view
Name Null? Type
----------------------------------------- -------- ----------------------------
LAST_NAME NOT NULL VARCHAR2(25)
FIRST_NAME VARCHAR2(20)
EMAIL NOT NULL VARCHAR2(25)
SALARY NUMBER(8,2)

bottom of page