Send feedback on this topic.
Teradata.Client.Provider
TdClob Class
Members  Example 



Teradata.Client.Provider Namespace : TdClob Class
TdClob represents a CLOB (Character Large Object) data type instance. It is used to retrieve CLOB data from the Advanced SQL Engine.
Object Model
TdClob ClassTdClob Class
Syntax
'Declaration
 
Public NotInheritable Class TdClob 
   Inherits System.MarshalByRefObject
   Implements System.Data.SqlTypes.INullableSystem.ICloneableSystem.IDisposable 
'Usage
 
Dim instance As TdClob
Remarks

TdClob does not expose any public constructor. It's primary purpose is to retrieve CLOB data from the Advanced SQL Engine.

In order to create an instance of TdClob, TdDataReader.GetTdClob method must be called when the data contained in a CLOB column is to be retrieved.

When a TdClob is created, the provider will open a request on the existing connection. This request is separate and independent from the request that was opened to process the query. The Advanced SQL Engine has a maximum number of open requests that it can support per connection. The limit is 16.

It is important that TdClob.Close or TdClob.Dispose is called after the TdClob has been used to process the CLOB. This will free up the resources and the request that was used to retrieve the CLOB from the Advanced SQL Engine. After a TdClob is disposed, an application can only call the Close and Dispose methods or the IsClosed property. All other methods and properties will throw an ObjectDisposedException exception.

A TdClob instance can only be created when the CLOB data is retrieved using deferred mode. This allows the data to be streamed from the Advanced SQL Engine to the Data Provider, and allows an application to retrieve the data in chunks from one or more LOBs.

An application is unable to access the base stream of the TdClob instance.

CLOB data is returned using deferred mode when Data.CommandBehavior.SequentialAccess has not been specified in the call to TdCommand.ExecuteReader.

Example
The following example displays a TdClob representing a resume.
public void DisplayEmployeeResume(String employeeId, TdConnection cn)
{
    TdCommand cmd = new TdCommand(“Select Resume from Employee Where ID = ?”, cn);
            
    // Initialize the parameter with employee ID.
    TdParameter id = cmd.CreateParameter();
    id.ParameterName = “EmployeeID”;
    id.Direction = System.Data.ParameterDirection.Input;
    id.Value = employeeId;
    
    cmd.Parameters.Add(id);
            
    // Execute the Query
    using (TdDataReader reader = cmd.ExecuteReader())
    {
        if (reader.Read())
        {
            // Retrieve the resume
            using (TdClob resume = reader.GetTdClob(0))
            {
                DisplayResume(resume);
            }
        }
    }
            
    // Dispose of the command
    cmd.Dispose();
}
Inheritance Hierarchy

System.Object
   System.MarshalByRefObject
      Teradata.Client.Provider.TdClob

Requirements

Target Platforms: Windows 8.1, Windows 10, Windows Server 2012 R2, Windows Server 2016, Windows Server 2019

See Also

Reference

TdClob Members
Teradata.Client.Provider Namespace