GRANT (Execute Privileges)

Grants privileges on executable database objects to users.

SYNTAX

executable_name Name of the executable object you want to grant execute privileges on.
user_name Name of the user you want to grant execute privileges to.
group_name Name of the group you want to grant execute privileges to.

DESCRIPTION

The GRANT (execute privileges) command grants execute privileges on executable database objects to individual users. To execute the GRANT (execute privileges) command, you must be the object owner, or have DBA or SYSADM security privileges.

Execute privileges control which executable database objects a user can use. DBMaker has three types of executable objects: stored commands, stored procedures, and projects.

The COMMAND keyword specifies that the object you are granting EXECUTE privileges on is a stored command. To execute a stored command, you must have all security and object privileges necessary to execute the SQL statement that makes up the stored command in addition to having execute privilege on the command.

The PROCEDURE keyword specifies that the object you are granting EXECUTE privileges on is a stored procedure. You do not need any additional security or object privileges to execute the stored procedure if you have EXECUTE privilege on the stored procedure.

The PROJECT keyword specifies that the object you are granting EXECUTE privileges on is a project containing one or more stored procedures. Granting EXECUTE privileges on a project automatically grants EXECUTE privileges on all procedures in that project.

The user who creates an executable database object is the owner of that object. The owner and any user with DBA or SYSADM security privileges automatically have EXECUTE privileges on that object. It is possible to grant EXECUTE privilege to all users simultaneously by granting the privilege to PUBLIC. All current and future users will then have EXECUTE privilege on the executable database object.

EXAMPLES

The following example grants EXECUTE privilege on the stored command named ListUserTables to the user named Vivian.

GRANT EXECUTE ON COMMAND ListUserTables TO Vivian

The following example grants EXECUTE privilege on the stored procedure named ShowUsers to the users named Jenny and John, and the group Managers.

GRANT EXECUTE ON PROCEDURE ShowUsers TO Jenny, John, Managers

The following example grants EXECUTE privileges on all stored procedures in the InternetFunc to all present and future users using the PUBLIC keyword.

GRANT EXECUTE ON PROJECT InternetFunc TO PUBLIC

RELATED COMMANDS

< EXECUTE COMMAND | Contents | GRANT (Object Privileges) >

Copyright 2002 SYSCOM Computer Engineering Co. All rights reserved.