DROP LIBRARY

Use the DROP LIBRARY command to remove an existing user-defined shared library from a database. When you drop a shared library, the shared library object files are also removed from the user code object repository.

Synopsis

Syntax for dropping a user-defined shared library:
DROP LIBRARY library_name

Input

The DROP LIBRARY command takes the following input:
Table 1. DROP LIBRARY input
Input Description
library_name Specifies the name of an existing user-defined shared library. For systems that support multiple schemas, you can specify a name in the format schema.library to drop a library in a different schema of the current database. You cannot drop a library in a different database.

Outputs

The DROP LIBRARY command has the following outputs:

Table 2. DROP LIBRARY outputs
Output Description
DROP LIBRARY The message that the system returns if the command is successful.
ERROR: RemoveLibrary: library libname does not exist The message that the system returns if the specified shared library does not exist in the current database.
ERROR: Can't delete library mylib - name depends on it The message that the system returns if you try to drop a user-defined shared library that is referenced by an existing UDX. The name value can be the name of another library or the signature of a UDF or UDA.

Description

You cannot drop a user-defined shared library that is in use in an active query. After the active query transaction completes, the system processes the DROP LIBRARY command to drop the shared library. The shared library must be defined in the current database.

Privileges required

To drop a shared library, you must meet one of the following criteria:
  • You must have the Drop privilege on the LIBRARY object.
  • You must have the Drop privilege on the specific shared library object.
  • You must own the shared library.
  • You must be the database admin user, own the current database, or own the current schema on systems that supports multiple schemas.

Common tasks

Use the DROP LIBRARY command to drop an existing shared library from a database.

Usage

The following is sample usage.
  • To drop a sample library mylib, enter:
    MYDB.SCHEMA(MYUSER)=> DROP LIBRARY mylib;