Granting the ability to execute a user-defined function (SQL)

Grant the ability to execute a user-defined function by granting the EXECUTE object-level privilege.

Prerequisites

You must be the owner of the user-defined function, or have EXECUTE privilege with administrative rights on the function.

Ownership of a user-defined function belongs to the user who created it, and no privilege is required for that user to execute it.

Task

You have created a function and you want other user to be able to use it.

  1. Connect to the database.
  2. Execute a GRANT EXECUTE statement similar to the following:
    GRANT EXECUTE ON function-name TO user-id;

The grantee can now execute the procedure.