ST_DISABLE_DB procedure

Use this stored procedure to remove resources that allow Db2® Spatial Extender to store and support spatial data.

This stored procedure helps you resolve problems or issues that arise after you enable your database for spatial operations. For example, you might enable a database for spatial operations and then decide to use another database with Db2 Spatial Extender instead. If you did not define any spatial columns or import any spatial data, you can invoke this stored procedure to remove all spatial resources from the first database. Because of the interdependency between spatial columns and the type definitions, you cannot drop the type definitions when columns of those types exist. If you already defined spatial columns but still want to disable a database for spatial operations, you must specify a value other than 0 (zero) for the force parameter to remove all spatial resources in the database that do not have other dependencies on them.

Authorization

The user ID under which this stored procedure is invoked must have DBADM authority on the database from which Db2 Spatial Extender resources are to be removed.

Syntax

Read syntax diagramSkip visual syntax diagramDB2GSE.ST_DISABLE_DB(forcenull, msg_code , msg_text )

Parameter descriptions

force
Specifies that you want to disable a database for spatial operations, even though you might have database objects that are dependent on the spatial types or spatial functions. Although you must specify a value for this parameter, the value can be null. If you specify a value other than 0 (zero) or null for the force parameter, the database is disabled, and all resources of the Db2 Spatial Extender are removed (if possible). If you specify 0 (zero) or null, the database is not disabled if any database objects are dependent on spatial types or spatial functions. Database objects that might have such dependencies include tables, views, constraints, triggers, generated columns, methods, functions, procedures, and other data types (subtypes or structured types with a spatial attribute).

The data type of this parameter is SMALLINT.

Output parameters

msg_code
Specifies the message code that is returned from the stored procedure. The value of this output parameter identifies the error, success, or warning condition that was encountered during the processing of the procedure. If this parameter value is for a success or warning condition, the procedure finished its task. If the parameter value is for an error condition, no changes to the database were performed.

The data type of this output parameter is INTEGER.

msg_text
Specifies the actual message text, associated with the message code, that is returned from the stored procedure. The message text can include additional information about the success, warning, or error condition, such as where an error was encountered.

The data type of this output parameter is VARCHAR(1024).

Example

This example shows how to use the Db2 command line processor to invoke the ST_DISABLE_DB stored procedure. This example uses a Db2 CALL command to disable the database for spatial operations, with a force parameter value of 1:

call DB2GSE.ST_DISABLE_DB(1,?,?)

The two question marks at the end of this CALL command represent the output parameters, msg_code and msg_text. The values for these output parameters are displayed after the stored procedure runs.