Comparing DML with IRowsetChange/IRowsetUpdate - OLE DB Provider for Teradata

OLE DB Provider for Teradata User Guide

Product
OLE DB Provider for Teradata
Release Number
15.00
Language
English (United States)
Last Update
2018-09-28
dita:id
B035-2498
Product Category
Teradata Tools and Utilities

Comparing DML with IRowsetChange/IRowsetUpdate

The decision to use DML statements or the IRowsetChange/IRowsetUpdate interface should be based on the functionality the consumer requires. For example:

 

Table 14: Deciding to Use DML Statements or IRowsetChange or IRowsetUpdate  

If the Consumer...

and the Consumer...

then the Consumer should use...

displays an interface that shows rows from a single table,

allows a user to specify what rows to update or delete,

the IRowsetChange or IRowsetUpdate interface.

generates data values,

inserts these values into several different tables,

DML statements.

The following table lists the advantages and disadvantages of each approach. In the table, “update” refers to inserting, updating, or deleting rows.

 

Table 15: Advantages of Using DML Statements or IRowsetChange or IRowsetUpdate  

Using DML

Using IRowsetChange / IRowsetUpdate

The SQL is either hard coded or logic must exist in the consumer to dynamically create the DML statements.

OLE DB Provider for Teradata generates DML statements.

There is possibly less overhead. The consumer does not have to create a rowset before updating the data.

The consumer must create a rowset before updating the underlying table.

The consumer can generate several different DML statements that update different tables or views.

The rowset to be updated can only derive from a single table or view. Therefore, the consumer can update only the single underlying table or view.

The consumer is responsible for caching updates to a table and then generating statements to perform updates.

OLE DB Provider for Teradata caches updates made to the rowset when methods in the IRowsetUpdate interface are called. OLE DB Provider for Teradata submits all the changes to Teradata Database when IRowsetUpdate::Update is called.

The consumer has total control of the DML statements.

OLE DB Provider for Teradata is limited to the columns included in the rowset when generating the WHERE clause of the DML statement. Columns of type FLOAT will not be included in the WHERE clause. This may cause unexpected rows to be updated. For more details, refer to “FLOAT, REAL, DOUBLE Restriction” on page 51.