This form of the GRANT statement grants privileges on a sequence.
This statement can be embedded in an application program or issued interactively. It is an executable statement that can be dynamically prepared.
The privileges held by the authorization ID of the statement must include at least one of the following:
If WITH GRANT OPTION is specified, the privileges held by the authorization ID of the statement must include at least one of the following:
.-PRIVILEGES-. >>-GRANT--+-ALL--+------------+-+-------------------------------> | .-,---------. | | V | | '---+-ALTER-+-+-------' '-USAGE-' .-,-------------. V | >--ON--SEQUENCE----sequence-name-+------------------------------> .-,----------------------. V | >--TO----+-authorization-name-+-+--+-------------------+------->< '-PUBLIC-------------' '-WITH GRANT OPTION-'
If you do not use ALL, you must use one or more of the keywords listed below. Each keyword grants the privilege described.
If WITH GRANT OPTION is omitted, the specified authorization-names cannot grant the USAGE privilege to others unless they have received that authority from some other source (for example, from a grant of the system authority *OBJMGT).
Corresponding System Authorities: GRANT and REVOKE statements assign and remove system authorities for SQL objects. The following table describes the system authorities that correspond to the SQL privileges:
SQL Privilege | Corresponding System Authorities when Granting to or Revoking from a Sequence |
---|---|
ALL (Grant or revoke of ALL grants or revokes only those privileges the authorization ID of the statement has) |
*OBJALTER *OBJOPR *EXECUTE *READ *ADD *DLT *UPD *OBJMGT (Revoke only) |
ALTER | *OBJALTER |
USAGE |
*OBJOPR *EXECUTE *READ *ADD *DLT *UPD |
WITH GRANT OPTION | *OBJMGT |
Corresponding System Authorities When Checking Privileges to a Sequence: The following table describes the system authorities that correspond to the SQL privileges when checking privileges to a sequence. The left column lists the SQL privilege. The right column lists the equivalent system authorities.
SQL Privilege | Corresponding System Authorities |
---|---|
ALTER | *OBJALTER |
USAGE |
*OBJOPR and *EXECUTE and *READ and *ADD and *DLT and *UPD |
Grant any user the USAGE privilege on a sequence called ORG_SEQ.
GRANT USAGE ON SEQUENCE ORG_SEQ TO PUBLIC