The Schema collections return metadata for the Teradata Database objects. The notable metadata columns for the VarByte data type are:
Column Name | Description |
---|---|
COLUMN_TYPE or DATA_TYPE |
Set to VARBYTE. |
CHARACTER_OCTET_LENGTH | Returns the maximum length of the column in Bytes. |
PROVIDERDBTYPE | It is set to TdType.VarByte. |
The TdDataReader.SchemaTable returns result set metadata. The notable metadata columns for the VarByte data type are:
Column Name | Description |
---|---|
ColumnSize | Returns the maximum length of the column in Bytes. |
DataType | System.Type object for the System.Byte[] type. |
ProviderType | Set to TdType.VarByte. |
Format | Teradata Database Format assigned to the Teradata Database object. |
ProviderSpecificDataType | System.Type object for the System.Byte[] class. |
The following example shows how to configure a VarByte parameter using DbType type declaration and a BCL value. The value is set to a System.Byte[] instance.
![]() |
---|
The Data Provider maps DbType.Binary to TdType.Clob when the TdParameter.Size property value is greater than 64,000 bytes. |
C# |
Copy Code
|
---|---|
TdParameter customerPicture = new TdParameter(); customerPicture.ParameterName = "customerPicture"; customerPicture.DbType = DbType.Binary; customerPicture.Value = pictureBuffer; |
The following example shows how to configure a VarByte parameter using TdType type declaration and a BCL value. The value is set to a System.Byte[] instance.
C# |
Copy Code
|
---|---|
TdParameter customerPicture= new TdParameter(); customerPicture.ParameterName = "customerPicture"; customerPicture.TdType = TdType.VarByte; customerPicture.Value = pictureBuffer; |
The TdParameter.Value must be set to an Array of Bytes (Byte[]).
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 Bytes the Data Provider will send to the Teradata Database and/or will receive from the Teradata Database. We recommend to set the TdParameter.Size property to the corresponding Teradata Database object size (e.g. Column or Stored Procedure Parameter size) for Input, InputOutput or Output parameters.
![]() |
---|
The Data Provider will truncate the data when the TdParameter.Size property value is less than the length of the Data received from the Teradata Database. |
![]() |
---|
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. |
The syntax for the BYTE Literal is 'hexadecimal digits'XBV. For example 'C1C0'XBV declares a VARBYTE(2) literals; the first byte is set to C1 and and the second byte is set to C0.
![]() |
---|
We recommend to always use Parameters in order to take advantage of the Teradata Database Request Cache. |
The following methods and properties return the column or parameter value as a System.Byte[] object.
The following method returns the column value as a System.Stream object.
Accessor Methods for Retrieving Data
Configuring Parameters and Parameter Data Types