ST_CREATE_COORDSYS procedure

Use this stored procedure to create a new coordinate system. When this stored procedure is processed, information about the coordinate system is added to the DB2GSE.ST_COORDINATE_SYSTEMS catalog view.

Authorization

The user ID under which the stored procedure is invoked must have DBADM authority.

Syntax

Read syntax diagramSkip visual syntax diagramDB2GSE.ST_CREATE_COORDSYS( coordsys_name,definition,organizationnull,organization_coordsys_idnull,descriptionnull, msg_code , msg_text )

Parameter descriptions

coordsys_name
Uniquely identifies the coordinate system. You must specify a non-null value for this parameter.

The coordsys_name value is converted to uppercase unless you enclose it in double quotation marks.

The data type of this parameter is VARCHAR(128) or, if you enclose the value in double quotation marks, VARCHAR(130).

definition
Defines the coordinate system. You must specify a non-null value for this parameter. The vendor that supplies the coordinate system usually provides the information for this parameter.

The data type of this parameter is VARCHAR(2048).

organization
Names the organization that defined the coordinate system and provided the definition for it; for example, "European Petroleum Survey Group (EPSG)." Although you must specify a value for this parameter, the value can be null.

If this parameter is null, the organization_coordsys_id parameter must also be null. If this parameter is not null, the organization_coordsys_id parameter cannot be null; in this case, the combination of the organization and organization_coordsys_id parameters uniquely identifies the coordinate system.

The data type of this parameter is VARCHAR(128).

organization_coordsys_id
Specifies a numeric identifier. The entity that is specified in the organization parameter assigns this value. This value is not necessarily unique across all coordinate systems. Although you must specify a value for this parameter, the value can be null.

If this parameter is null, the organization parameter must also be null. If this parameter is not null, the organization parameter cannot be null; in this case, the combination of the organization and organization_coordsys_id parameters uniquely identifies the coordinate system.

The data type of this parameter is INTEGER.

description
Describes the coordinate system by explaining its application. Although you must specify a value for this parameter, the value can be null. If this parameter is null, no description information about the coordinate system is recorded.

The data type of this parameter is VARCHAR(256).

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_CREATE_COORDSYS stored procedure. This example uses a Db2 CALL command to create a coordinate system with the following parameter values:
  • coordsys_name parameter: NORTH_AMERICAN_TEST
  • definition parameter:
    
    GEOGCS["GCS_North_American_1983",
    DATUM["D_North_American_1983",
    SPHEROID["GRS_1980",6378137.0,298.257222101]],
    PRIMEM["Greenwich",0.0],
    UNIT["Degree",0.0174532925199433]]
    
  • organization parameter: EPSG
  • organization_coordsys_id parameter: 1001
  • description parameter: Test Coordinate Systems

call DB2GSE.ST_CREATE_COORDSYS('NORTH_AMERICAN_TEST',
     'GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",
     SPHEROID["GRS_1980",6378137.0,298.257222101]],
     PRIMEM["Greenwich",0.0],UNIT["Degree",
     0.0174532925199433]]','EPSG',1001,'Test Coordinate Systems',?,?)

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.