Parses a string defining the type string.
ST_Geometry::ST_GeometryTypeFromBaseType(base-type-str)
base-type-str
VARCHAR(128)
A string containing the base type string
VARCHAR(128) Returns the geometry type from a base type string (which may include an SRID definition). If the type string is not a valid geometry type string, an error is returned.
The ST_Geometry::ST_GeometryTypeFromBaseType method can be used to parse the geometry type name out of a type string definition.
SQL/MM (ISO/IEC 13249-3: 2006) Vendor extension
The following example returns the result ST_Geometry.
ST_Geometry
SELECT ST_Geometry::ST_GeometryTypeFromBaseType('ST_Geometry')
The following example returns the result ST_Point.
ST_Point
SELECT ST_Geometry::ST_GeometryTypeFromBaseType('ST_Point(SRID=4326)')
The following example finds the geometry type (ST_Point) accepted by a stored procedure parameter.
CREATE PROCEDURE myprocedure( parm1 ST_Point(SRID=0) ) BEGIN -- ... END; SELECT parm_name nm, base_type_str, ST_Geometry::ST_GeometryTypeFromBaseType(base_type_str) geom_type FROM sysprocedure KEY JOIN sysprocparm WHERE proc_name='myprocedure' and parm_name='parm1'