Calling Db2 Spatial Extender stored procedures from an application

If you plan to write application programs that call any of the Db2 Spatial Extender stored procedures, you use the SQL CALL statement and specify the name of the stored procedure.

About this task

Db2 Spatial Extender stored procedures are created when you enable the database for spatial operations.

Procedure

To call Db2 Spatial Extender stored procedures from an application:

  1. Call the DB2GSE.ST_ENABLE_DB stored procedure to enable a database for spatial operations.
    Specify the stored procedure name as follows:
    CALL DB2GSE!ST_ENABLE_DB
    

    The DB2GSE! in this call represents the Db2 Spatial Extender library name. The ST_ENABLE_DB procedure is the only one in which you need to include an exclamation mark in the call (that is, DB2GSE!).

  2. Call other Db2 Spatial Extender stored procedures.
    Specify the stored procedure name in the following form, where DB2GSE is the schema name for all Db2 Spatial Extender stored procedures, and spatial_procedure_name is the name of the stored procedure. Do not include an exclamation mark in the call.
    CALL DB2GSE.spatial_procedure_name
    
    The Db2 Spatial Extender stored procedures are shown in the following table.
    Table 1. Db2 Spatial Extender stored procedures
    Stored procedure Description
    ST_ALTER_COORDSYS Updates an attribute of a coordinate system in the database.
    ST_ALTER_SRS Updates an attribute of a spatial reference system in the database.
    ST_CREATE_COORDSYS Creates a coordinate system in the database.
    ST_CREATE_SRS Creates a spatial reference system in the database.
    ST_DISABLE_AUTOGEOCODING Specifies that Db2 Spatial Extender is to stop synchronizing a geocoded column with its associated geocoding columns.
    ST_DISABLE_DB Removes resources that allow Db2 Spatial Extender to store spatial data and to support operations that are performed on this data.
    ST_DROP_COORDSYS Deletes a coordinate system from the database.
    ST_DROP_SRS Deletes a spatial reference system from the database.
    ST_ENABLE_AUTOGEOCODING Specifies that Db2 Spatial Extender is to synchronize a geocoded column with its associated geocoding columns.
    ST_ENABLE_DB Supplies a database with the resources that it needs to store spatial data and to support operations.
    ST_EXPORT_SHAPE Exports selected data in the database to a shape file.
    ST_IMPORT_SHAPE Imports a shape file to a database.
    ST_REGISTER_GEOCODER Registers a geocoder other than DB2SE_USA_GEOCODER, which is part of the Db2 Spatial Extender product.
    ST_REGISTER_SPATIAL_COLUMN Registers a spatial column and associates a spatial reference system with it.
    ST_REMOVE_GEOCODING_SETUP Removes all the geocoding setup information for the geocoded column.
    ST_RUN_GEOCODING Runs a geocoder in batch mode.
    ST_SETUP_GEOCODING Associates a column that is to be geocoded with a geocoder and sets up the corresponding geocoding parameter values.
    ST_UNREGISTER_GEOCODER Unregisters a geocoder.
    ST_UNREGISTER_SPATIAL_COLUMN Removes the registration of a spatial column.