Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

syntax error for command: "GRANT EXECUTE ON USERNAME.PKG.PROCEDURE TO OTHERUSER;"

I want to grant execute permission to user B so that it can execute a packaged procedure belonging to user A.

procedure name = PKGNAME.PROCEDURENAME
user = USERA

I am trying below command:

GRANT EXECUTE ON USERA.PKGNAME.PROCEDURENAME TO USERB;

But it gives me error:

ERROR at line 1:
ORA-00905: missing keyword

is there a syntax problem ? I used this link : Granting Rights on Stored Procedure to another user of Oracle

like image 291
darshanUser Avatar asked Aug 16 '26 13:08

darshanUser


1 Answers

you can't grant permissions on a procedure which is within a package, either grant permissions to the entire package or move the procedure outside of the package so it's a stand alone one and then grant permission

so either

GRANT EXECUTE ON USERA.PKGNAME TO USERB;

or

GRANT EXECUTE ON USERA.PROCEDURENAME TO USERB;
like image 149
davegreen100 Avatar answered Aug 18 '26 03:08

davegreen100