The following are guidelines that will enable the Data Provider to efficiently process batches:
After TdDataAdapter.Update returns, the application will have to check the rows in the DataTable to verify that the corresponding SQL table was updated. The following need to be performed by the application:
Check the DataRow.RowError property. If the row was successfully processed this property will be an empty string. When this occurs, verify that the DataRow.RowState property is set to DataRow.Unchanged.
When the SQL Engine generates an error while processing a row, the DataRow.Error property will contain the error message. The DataRow.RowState will not have been changed. These rows need to be fixed and the TdDataAdapter.Update called again so that the corresponding SQL table can be updated with these rows.
The RowStatus and RowError properties will not show that the rows in the DataTable were rolled back when TdTransaction.Rollback is called to rollback the changes that were applied by TdDataAdapter.Update. For example, if rows in the DataTable were successfully applied to the corresponding SQL table, the RowState will be set to DataRowState.Unchanged. The state will not revert back to the original value when TdTransaction.Rollback is called.
Refer to Behavior When Batch Processing with Different Settings
The following items can affect the behavior of DataAdapter.Update:
There is a difference in the Transaction Processing when the Session Mode is to Teradata versus ANSI.
Batches that contains INSERT statements will be processed by the SQL Engine using Statement Independence. Using this feature enables the Data Provider to more efficiently process the batch. The SQL Engine cannot process DELETE and UPDATE statements using Statement Independence. Processing of batches that contain these statement are less efficient.
Indicates whether processing of batches will continue when an error is encountered.
The Data Provider will use the size to determine whether to use Parameter Arrays (Iterated Request) or a multi-statement request to send the rows of the DataTable to the SQL Engine. The Data Provider will use Parameter Arrays to process a batch if the value is 5 or greater.
The transaction processing is slightly different depending upon the type of DML that is being processed and the session mode. See Detailed Behavior of TdDataAdapter.Update for more information.
Continue Processing When Error Occur in Batch
How Statement Independence Affects Batch Update
Behavior When Batch Processing with Different Settings