db2se setup_gc command

The db2se setup_gc command associates a column that is to be geocoded with a geocoder and to set up the corresponding geocoding parameters.

The information about this setup is available from the DB2GSE.ST_GEOCODING and DB2GSE.ST_GEOCODING_PARAMETERS catalog views.

Authorization

The user ID must hold one of the following authorities or privileges to run this command:
  • DATAACCESS authority on the database that contains the table on which the specified geocoder is to operate
  • CONTROL privilege on this table
  • UPDATE privilege on this table

Command syntax

db2se setup_gc command

Read syntax diagramSkip visual syntax diagramsetup_gcdatabase_name-userIduser_id-pwpassword -tableSchematable_schema-tableNametable_name -columnNamecolumn_name -geocoderNamegeocoder_name -parameterValuesparameter_values-autogeocodingColumnsauto_gc_columns-whereClausewhere_clause-commitScopen

Command parameters

Where:
database_name
Specifies the name of the database for which you want to set up a geocoder.
-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 for the specified column_name. The table_name value is converted to uppercase unless you enclose it in double quotation marks.
-columnName column_name
Identifies the column name into which the geocoded data is to be inserted or updated. The column_name value is converted to uppercase unless you enclose it in double quotation marks.
-geocoderName geocoder_name
Uniquely identifies a previously registered geocoder that is to perform the geocoding. The geocoder_name value is converted to uppercase unless you enclose it in double quotation marks. The maximum length for this parameter is 128 characters.
-parameterValues parameter_values
Specifies the list of geocoding parameter values for the geocoder function. If this parameter is not specified, the default parameter values that were specified when you register the geocoder are used.
You must specify the parameter values in the order that the function defined them, and separate them with a comma. For example:
default_parm1_value,default_parm2_value,...
Each parameter value must be an SQL expression. Follow these guidelines to specify default parameter values:
  • If a value is a string, enclose it in single quotation marks.
  • If a parameter value is a number, do not enclose it in single quotation marks.
  • If the parameter value is null, cast it to the correct type. For example, specify the following expression to indicate a NULL for an integer parameter: CAST(NULL AS INTEGER).
  • If the geocoding parameter is to be a geocoding column, do not specify a default parameter value.

Use two consecutive commas (...,,...) to omit values for parameters that you indicate when you set up or register the geocoder.

The maximum length for this parameter is 32,672 characters.

-whereClause where_clause
Specifies the text for a search condition of a WHERE clause to filter the set of records to be geocoded. If this parameter is not specified, all the rows in the table are geocoded.

You can specify a clause that references any column in the table or view that the geocoder is to operate on.

Do not specify the keyword WHERE in where_clause.

The maximum length for this parameter is 32,672 characters.

-commitScope n
Specifies that a COMMIT is to be performed after every n records are geocoded. If this parameter is not specified, a COMMIT is performed at the end of the operation. One COMMIT at the end of the operation can result in large log file utilization and data lost on operations that are interrupted.

Usage notes

This command does not invoke geocoding. It provides a way for you to specify parameter settings for the column that is to be geocoded. Parameter settings that are specified in geocoding setup override any of the default parameter values specified in the geocoder registration.

You must run this command before enabling autogeocoding. Setting up the geocoding parameters is required before enabling autogeocoding.

You can run this command before geocoding in batch mode. If you do not specify any parameter values for running geocoding in batch mode, the parameter values specified in geocoding setup are used. If you specify parameter values, these values override the parameter values specified in geocoding setup.

Examples

The following example sets up geocoding operations to populate a spatial column named MYCOLUMN in table MYTABLE.
db2se setup_gc mydb -tableName mytable -columnName mycolumn 
        -parameterValues "address,city,state,zip,2,90,70,20,1.1,'meter',4.."
        -autogeocodingColumns address,city,state,zip
        -commitScope 10