DROP SEQUENCE (Delete sequence generator)

Function

DROP SEQUENCE deletes a sequence generator.

Privileges

The owner of a sequence generator to be specified
The owner of a sequence generator can delete that sequence generator.
Users with the DBA privilege
These users can delete their own sequence generators and sequence generators owned by other users.

Format

DROP SEQUENCE [authorization-identifier.]sequence-generator-identifier[WITH PROGRAM]

Operands

authorization-identifier
Specifies the authorization identifier of the user that owns the sequence generator.
If this is omitted, the authorization identifier of the executing user is assumed.
sequence-generator-identifier
Specifies the name of the sequence generator to be deleted.
WITH PROGRAM
Specify this operand to disable another user's valid SQL object for a procedure or trigger that uses a sequence generator when deleting a sequence generator.
The sequence generator cannot be deleted if there is a valid SQL object of a trigger or procedure that uses the sequence generator and WITH PROGRAM is omitted.

Common rules

  1. If the SQL object being executed is invalidated, DROP PUBLIC FUNCTION cannot be executed from within a Java procedure.

Notes

  1. DROP SEQUENCE cannot be specified from an X/Open-compliant UAP running under OLTP.
  2. If a valid SQL object of a procedure or trigger is disabled by specifying WITH PROGRAM, the information about the disabled procedure or trigger in the SQL_ROUTINE_RESOURCES dictionary table is deleted.
  3. To execute an SQL object of a procedure or trigger that has been disabled by specifying WITH PROGRAM, you must execute ALTER ROUTINE or ALTER PROCEDURE to recreate the SQL object of the procedure or trigger.

Examples

Deletes a sequence generator (SEQ1).

   DROP SEQUENCE SEQ1