Send feedback on this topic.
Teradata.Client.Provider
MBB Data Type
.NET Data Provider for Teradata > Developer's Guide > Data Types > Geospatial Data Types > MBB Data Type

Schema Collections

The Schema collections return metadata for the Teradata Database objects. The notable metadata columns for the MBB data type are:

Column Name Description

COLUMN_TYPE

or

DATA_TYPE

Set to MBB.
FORMAT Teradata Database Format assigned to the Teradata Database object.
PROVIDERDBTYPE Set to DBNull.Value

Schema Table

The TdDataReader.SchemaTable returns result set metadata. The notable metadata columns for the MBB data type transformed to VarChar(340) are:

Column Name Description
ColumnSize Returns the maximum length of the column in Characters; in this case 340.
DataType System.Type object for the System.String type.
ProviderType Set to TdType.VarChar.
ProviderSpecificDataType System.Type object for the System.String class.

Configuring Parameters

The following example shows how to configure a MBB parameter using DbType type declaration and a BCL value. The value is set to a System.String instance.

C#
Copy Code
TdParameter shapeMBB = new TdParameter();
shapeMBB.ParameterName = "shapeMBB";

shapeMBB.DbType = DbType.String;

shapeMBB.Value = "(20,20,20,30,30,30)";

The following example shows how to configure a MBB parameter using TdType type declaration and a BCL value.

C#
Copy Code
TdParameter shapeMBB = new TdParameter();
shapeMBB.ParameterName = "shapeMBB";

shapeMBB.TdType = TdType.VarChar;

shapeMBB.Value = "(20,20,20,30,30,30)";

The TdParameter.Value should be set to an Array of Characters (Char[]), String object or an object that supports conversion ( Convert.ToString) to System.String.

Set TdParameter.Size Property for InputOutput or Output Parameters

The TdParameter.Size property must be set to 340 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 (or Bytes) the Data Provider will send to the Teradata Database and/or will receive from the Teradata Database. 

Note

TdParameter.Size is not required for Input parameters. However it will improve the overall performance of Batch Updates. Therefore the general guideline is to always set the TdParameter.Size property to 340.

Retrieving MBB Data

The following methods and properties return the column value as a System.Char[] object.

  1. TdDataReader.GetChars
  2. TdDataReader.GetFieldValue<Char[]>
  3. TdParameter.GetValue<Char[]>

The following methods and properties return the column or parameter value as a System.String object.

  1. TdDataReader.GetString
  2. TdDataReader.GetValue
  3. TdDataReader.GetProviderSpecificValue
  4. TdDataReader.GetFieldValue<String>
  5. TdParameter.Value
  6. TdParameter.GetValue<String>

See Also

Data Type Mappings

Accessor Methods for Retrieving Data

Configuring Parameters and Parameter Data Types