GRANT (plan privileges)

This form of the GRANT statement grants privileges on plans.

Syntax

Read syntax diagram
          .-,-----------.           .-,---------.   
          V             |           V           |   
>>-GRANT----+-BIND----+-+--ON PLAN----plan-name-+--------------->
            '-EXECUTE-'                             

       .-,----------------------.                          
       V                        |                          
>--TO----+-authorization-name-+-+--+-------------------+-------><
         +-ROLE--role-name----+    '-WITH GRANT OPTION-'   
         '-PUBLIC-------------'                            

Description

BIND
Grants the privilege to use the BIND, REBIND, and FREE subcommands for the identified plans. (The authority to create new plans using BIND ADD is a system privilege.)
EXECUTE
Grants the privilege to run programs that use the identified plans.
ON PLAN plan-name,...
Identifies the application plans on which the privileges are granted. For each identified plan, you must have all specified privileges with the GRANT option.
TO
Refer to GRANT for a description of the TO clause.
WITH GRANT OPTION
Refer to GRANT for a description of the WITH GRANT OPTION clause.

Examples

Example 1: Grant the privilege to bind plan DSN8IP10 to user JONES.
   GRANT BIND ON PLAN DSN8IP10 TO JONES;
Example 2: Grant privileges to bind and execute plan DSN8CP10 to all users at the current server.
   GRANT BIND,EXECUTE ON PLAN DSN8CP10 TO PUBLIC;
Example 3: Grant the privilege to execute plan DSN8CP10 to users ADAMSON and BROWN with grant option.
   GRANT EXECUTE ON PLAN DSN8CP10 TO ADAMSON,BROWN WITH GRANT OPTION;
Example 4: Grant the privileges to bind the DSN91PLN plan to role ROLE1:
GRANT BIND ON PLAN DSN91PLN TO ROLE ROLE1;