The Schema collections return metadata for the Advanced SQL Engine objects. The notable metadata columns for the ST_Geometry data type are:
Column Name | Description |
---|---|
COLUMN_TYPE or DATA_TYPE |
Set to ST_GEOMETRY. |
FORMAT | Format assigned to the SQL Engine object. |
PROVIDERDBTYPE | Set to DBNull.Value |
The TdDataReader.SchemaTable returns result set metadata. The notable metadata columns for the ST_Geometry data type transformed to Clob data type are:
Column Name | Description |
---|---|
ColumnSize | Returns the maximum length ST_Geometry column in Characters. |
DataType | System.Type object for the System.String type. |
ProviderType | Set to TdType.Clob. |
Format | Format assigned to the SQL Engine object. |
ProviderSpecificDataType | System.Type object for the TdClob class. |
The following example shows how to configure a ST_Geometry parameter as Clob using DbType type declaration, Size property and a BCL value. The value is set to a System.String instance.
C# |
Copy Code |
---|---|
TdParameter point1 = new TdParameter(); point1.ParameterName = "point"; point1.DbType = DbType.String; point1.Size = 100; point1.Value = "POINT(20 10)"; |
![]() |
---|
The SQL Engine transforms VarChar or Clob input parameters to ST_Geometry data type. Therefore applications can use TdType.VarChar or TdType.Clob as input parameter type. The Data Provider maps DbType.String to the SQ VarChar Data Type when Size is less than or equal to 64,000 characters. The Data Provider maps DbType.String to the SQL CLOB Data Type when Size is greater than 64,000. The Data Provider transmits CLOB input parameters separately from all other data types. Therefore the general guideline is to use TdType.VarChar parameter type when the size of ST_Geometry input parameter is small; it will improve the overall performance. |
The following example shows how to configure a ST_Geometry parameter as TdType.Clob and a BCL value.
C# |
Copy Code |
---|---|
TdParameter point1 = new TdParameter(); point1.ParameterName = "point1"; point1.TdType = TdType.Clob; point1.Value = "POINT(10 20)"; |
The TdParameter.Value should be set to an Array of Characters (Char[]), String object or an instance of System.IO.TextReader.
The TdParameter.Size property must be set to a number greater than Zero for InputOutput or Output Parameters. The Data Provider will throw an exception when TdParameter.Direction property is set to ParameterDirection.Output or ParameterDirection.InputOutput and TdParameter.Size property is set to Zero. The TdParameter.Size property specifies the maximum number of Unicode Characters the Data Provider will send to the SQL Engine and/or receive from the SQL Engine.
The following methods return the column or parameter value as a System.Char[] object.
The following methods and properties return the column or parameter value as a System.String object.
The following methods and properties return the column or parameter value as a TdClob class.
![]() |
---|
The CommandBehavior (see TdCommand.ExecuteReader(CommandBehavior)) must not include CommandBehavior.SequentialAccess. |
![]() |
---|
The CommandBehavior.SequentialAccess can potentially result in best overall performance. However in this mode ST_Geometry data type cannot be transformed to TdClob class. The CommandBehavior.SequentialAccess reduces the overall messages between the Data Provider and the SQL Engine because LOBs are transmitted to the Data Provider in Inline-mode. |
Accessor Methods for Retrieving Data
Configuring Parameters and Parameter Data Types