Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Assigning object privileges to a role

GusoraNov 16 2016 — edited Nov 22 2016

Found the statement below in the Oracle documentation (see bottom of page). If I use the reserved word 'table' in my grant statements I'll get an error.

GRANT SELECT ON TABLE t TO purchases_reader_role

Found the statement below in the Oracle documentation.(see examples at bottom of page)

GRANT ALL ON bonuses TO hr WITH GRANT OPTION;

Which if I replicate both grant statements give the error below.

create role higher;

create table test(cola number);

grant select, insert, update, delete on test to higher with grant option;

grant all on test to higher with grant option;

SQL Error: ORA-01926: cannot GRANT to a role WITH GRANT OPTION

01926. 00000 -  "cannot GRANT to a role WITH GRANT OPTION"

*Cause:    Role cannot have a privilege with the grant option.

*Action:   Perform the grant without the grant option.

Wondering what I'm doing wrong or not understanding correctly?!

This post has been answered by Cookiemonster76 on Nov 16 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 20 2016
Added on Nov 16 2016
12 comments
1,452 views