Skip to Main Content
  • Questions
  • GRANT CREATE FUNCTION TO edeploymentuser; : FAILS with an error

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Nishant .

Asked: January 18, 2017 - 5:48 pm UTC

Last updated: January 20, 2017 - 12:11 pm UTC

Version: 11.2.0.4

Viewed 50K+ times! This question is

You Asked

Hello All,

I have created a user "edeploymentuser" and granted permissions to create/alter session, create table, create index, create procedure successfully.
But, when I try to grant create function permission to the user it gives me the error below :-

SQL> GRANT CREATE FUNCTION to edeploymentuser;
GRANT CREATE FUNCTION to edeploymentuser
*
ERROR at line 1:
ORA-00990: missing or invalid privilege



I tried different below mentioned alterations in the command, but everything failed with the same error :-

- grant create function to edeploymentuser;
- grant create functions to edeploymentuser;
- grant create any function to edeploymentuser;
- grant create any functions to edeploymentuser;


am i doing anything wrong or missing anything.. ?

and Connor said...

A function is just a special form of a stored procedure.

Hence all you need is: grant create PROCEDURE to xxx

SQL> grant create session, create procedure to myuser identified by myuser;

Grant succeeded.

SQL> conn myuser/myuser
Connected.

SQL> create or replace function FFF return number is begin return 1; end;
  2  /

Function created.



Rating

  (3 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Thanks

Nishant Naidu, January 19, 2017 - 11:17 am UTC

Thanks .. it solves my problem.
Connor McDonald
January 20, 2017 - 12:11 pm UTC

glad we could help

Thanks

Kleitom Antonio, April 24, 2018 - 6:15 pm UTC

I was researching how i could to permition a creation of a funcion. Thanks for it.

A reader, July 07, 2022 - 5:37 am UTC

Thanks

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library