Pages

Thursday, November 17, 2022

ora-01720 undefined grant option does not exist

===================
General
===================
User B has a permission to do SELECT from USER_A.TABLE_A.
But is getting an error when trying to create a view with 
USER_A.TABLE_A.

ORA-01720 means that the grantor doesn't have the right privilege to grant a view to the third user.

===================
Example and Solution
===================
USER_A
GRANT SELECT ON TABLE_A TO USER_B;

USER_B
SELECT * FROM USER_A.TABLE_A;
--OK

CREATE OR REPLACE VIEW VIEW_A AS SELECT * FROM USER_A.TABLE_A;
ORA-01720 undefined grant option does not exist for

Solution:
USER_A
GRANT SELECT ON TABLE_A TO USER_B WITH GRANT OPTION;

USER_B
CREATE OR REPLACE VIEW VIEW_A AS SELECT * FROM USER_A.TABLE_A;
--OK;

No comments:

Post a Comment