db2se enable_autogc command

The db2se enable_autogc command enables autogeocoding.

This command enables Db2® Spatial Extender to synchronize a geocoded column with its associated geocoding column or columns. A geocoding column is used as input to the geocoder. Each time that values are inserted into, or updated in, the geocoding column or columns, triggers are activated. These triggers invoke the associated geocoder to geocode the inserted or updated values and to place the resulting data in the geocoded column. The information about geocoded columns is available from the DB2GSE.ST_GEOCODING catalog view.

Authorization

The user ID must have one of the following authorities or privileges to run this command:
  • DBADM and DATAACCESS authority on the database that contains the table on which the triggers that are created by this stored procedure are defined
  • CONTROL privilege on the table
  • ALTER privilege on the table
If the authorization ID of the statement does not have DBADM authority, the privileges that the authorization ID of the statement holds (without considering PUBLIC or group privileges) must include all of the following privileges as long as the trigger exists:
  • SELECT privilege on the table on which autogeocoding is enabled or DATAACCESS authority.
  • Necessary privileges to evaluate the SQL expressions that are specified for the parameters in the geocoding setup.

Command syntax

db2se enable_autogc command

Read syntax diagramSkip visual syntax diagramenable_autogcdatabase_name-userIduser_id-pwpassword -tableSchematable_schema-tableNametable_name -columnNamecolumn_name

Command parameters

Where:
database_name
Specifies the name of the database for which you want to enable autogeocoding.
-userId user_id
Specifies the database user ID that has DATAACCESS authority on the database indicated by database_name.
-pw password
Specifies the password for user_id.
-tableSchema table_schema
Specifies the schema name for the specified table_name. If you do not specify a schema name, the value in the CURRENT SCHEMA special register is used as the schema name for the table or view.
-tableName table_name
Specifies the unqualified name of the table containing the specified column on which you want to enable autogeocoding. The triggers are created to synchronize the geocoded column. The table_name value is converted to uppercase unless you enclose it in double quotation marks.
-columnName column_name
Identifies the column into which the geocoded data is to be inserted or updated. This column is referred to as the geocoded column. The column_name value is converted to uppercase unless you enclose it in double quotation marks.

Usage notes

Before enabling autogeocoding, you must perform the geocoding setup step to specifies the geocoder and the geocoding parameter values. It also identifies the geocoding columns that are to be synchronized with the geocoded columns.

You can enable autogeocoding only on tables on which INSERT and UPDATE triggers can be created. Consequently, you cannot enable autogeocoding on views or nicknames.

Examples

The following example sets up automatic geocoding for a column named MYCOLUMN in table MYTABLE

db2se enable_autogeocoding mydb -tableName mytable -columnName mycolumn