top of page
CerebroSQL

Oracle:

CREATE CONTEXT

CREATE [ OR REPLACE ] CONTEXT namespace
USING [ schema. ] package
[ INITIALIZED { EXTERNALLY | GLOBALLY }
| ACCESSED GLOBALLY
] ;

example

CREATE CONTEXT hr_context USING emp_mgmt;

CREATE VIEW hr_org_secure_view AS
SELECT * FROM employees
WHERE department_id = SYS_CONTEXT('hr_context', 'department_id');

bottom of page