Send feedback on this topic.
Teradata.Client.Provider
LOB's Cannot be Specified in Set Operations
.NET Data Provider for Teradata > Developer's Guide > ADO.NET Entity Provider for Teradata > Restrictions using the Entity Framework with Teradata > Restrictions using the Entity Provider > LOB's Cannot be Specified in Set Operations
.NET CORE   This feature is not supported by the .NET Core implementation of the Data Provider.

Each operand of a Set operation is a SELECT statement. The Advanced SQL Engine does not support columns that are defined as a LOB in the columns-list of the SELECT statement. A TdException will be thrown indicating that the LOB column could not be hashed.

In the following example, the LOBEntity is an entity that contains two properties that are defined as EDM.String: clob1, clob2. These two columns map to CLOB columns in a table contained in a Database. The Entity Sql contained in this example cannot be executed because there is a property that maps to a CLOB column specified in the projection.

Lob Example
Copy Code
public void ExampleLob()
{
   // Setting up the connection string to the data provider
   TdConnectionStringBuilder tbuilder = new TdConnectionStringBuilder();
   tbuilder.Database = "Database";
   tbuilder.DataSource = "Source";
   tbuilder.UserId = "user";
   tbuilder.Password = "password";

   EntityConnectionStringBuilder ebuilder = new EntityConnectionStringBuilder();

   // Setting up the connection for the Entity Framework
   ebuilder.Metadata = @"res://Example/EDMExample.csdl|res://Example/EDMExample.msl|res://Example/EDMExample.ssdl");
   ebuilder.Provider = "Teradata.Client.Provider";
   ebuilder.ProviderConnectionString = tbuilder.ToString();

   EntityConnection eConn = new EntityConnection(ebuilder.ToString());
   EntityCommand eCmd = eConn.CreateCommand();

   eCmd.CommandText = "(select l.c1_integer, e.clob1 from LOBEntity as l) " +
      "union all " +
      "(select ll.c1_integer, e.clob2 from LOBEntity as ll)";

   EntityDataReader eDr = eCmd.ExecuteReader(CommandBehavior.SequentialAccess);

   // Process each record returned

}