db2se register_spatial_column command
The db2se register_spatial_column command registers a spatial column and associates it to a spatial reference system (SRS).
Registering a spatial column creates a constraint on the table, if possible, to ensure that all geometries use the specified SRS.
Also, you can use this command to update the spatial extent information.
The information about registered spatial columns and spatial extents is available from the DB2GSE.ST_GEOMETRY_COLUMNS catalog view.
Authorization
The user ID must hold one
of the following authorities or privileges to run this command:
- DBADM and DATAACCESS authority on the database that contains the table to which the spatial column that is being registered belongs
- CONTROL privilege on this table
- ALTER privilege on this table
Command syntax
Command parameters
Where:
- Specifies the name of the database for which you want to registers a spatial column.
- Specifies the database user ID that has DATAACCESS authority on the database indicated by database_name.
- Specifies the password for user_id.
- 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.
- Specifies the unqualified name of the table that contains the column that is being registered. The table_name value is converted to uppercase unless you enclose it in double quotation marks.
- Identifies the column to be registered. The column_name value is converted to uppercase unless you enclose it in double quotation marks.
- Identifies the spatial reference system that is to be used for this spatial column. The srs_name value is converted to uppercase unless you enclose it in double quotation marks.
- Indicates whether to compute the geographic extents of a specified
column and make them available through the DB2GSE.ST_GEOMETRY_COLUMNS
catalog view. The possible values for this parameter are:
- A value greater than 0 to compute the geographic extents.
- Null, 0, or negative value to prevent this computation.
If you omit this parameter, it has the same effect as specifying 0. The extent computation is not performed.
Examples
The
following example registers a spatial column named MYCOLUMN in table
MYTABLE, with spatial reference system USA_SRS_1
.
db2se register_spatial_column mydb
-tableName mytable -columnName mycolumn -srsName USA_SRS_1