Useful shortcuts for vi editor

Showing posts with label ORA-01720. Show all posts
Showing posts with label ORA-01720. Show all posts

Friday 2 March 2018

ORA-01720 solution

Preparation
"employees" table exists in HR schema

"v_employees" view exists in HR2 schema;
SQL> grant select on hr.employees_new to hr2;
SQL> create view hr2.v_employees as select * from hr.employees;

User wants to see H2.V_EMPLOYEES view with HR3 user.
Action
SQL> grant select on hr2.v_employees to hr3;

Error
ORA-01720: grant option does not exist for 'HR.EMPLOYEES'

Solution
Append grant option to HR.EMPLOYEES table for HR2 user
SQL> grant select on hr.employees to hr2 with grant option;

Then, grant select permission to HR3 user
SQL> grant select on hr2.v_employees to hr3;

Result
SQL> select * from HR2.v_employees;