Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
Grants privilege to use a specified sequence.
GRANT USAGE ON SEQUENCE sequence-name TO userid, ...
This privilege allows the user to select the current or next value from the specified sequence.
You must have the MANAGE ANY OBJECT PRIVILEGE privilege.
Part of optional ANSI/ISO SQL Language Feature T176.
A ticketing application creates a sequence to ensure that each ticket has an unique number.
CREATE SEQUENCE TicketNumber MINVALUE 1000 MAXVALUE 100000;
A user, TicketAgent, using this application to generate tickets must be granted the usage rights to the sequence so that they can select values from the sequence.
GRANT USAGE ON SEQUENCE TicketNumber to TicketAgent;
Now, TicketAgent can select values from the TicketNumber sequence and use them to create new tickets. For example:
INSERT INTO NewTicket SELECT TicketNumber.nextval, 'Concert Ticket', ...;