Send feedback on this topic.
Teradata.Client.Provider
GetInsertCommand() Method



Teradata.Client.Provider Namespace > TdCommandBuilder Class > GetInsertCommand Method : GetInsertCommand() Method
Gets the TdCommand object with the required CommandText and Parameters properties to insert a row.
Syntax
'Declaration
 
Public Overloads Shadows Function GetInsertCommand() As TdCommand
'Usage
 
Dim instance As TdCommandBuilder
Dim value As TdCommand
 
value = instance.GetInsertCommand()
public new TdCommand GetInsertCommand()
public:
new TdCommand^ GetInsertCommand(); 

Return Value

A TdCommand object with required CommandText property and Parameters collection properly set for a insert operation.
Exceptions
ExceptionDescription
The DataAdapter property is not set, SelectCommand of the associated TdDataAdapter is not set or No TdConnection is associated with DataAdapter.SelectCommand
The TdCommandBuilder is closed / disposed.
Remarks

The invocation of GetInsertCommand method can result in one or more calls to the Teradata Database to retrieve metadata (Column and Table information). The metadata is cached in order to minimize roundtrips to the Advanced SQL Engine. The cache is purged only when the DataAdapter property is set or the Refresh method is called

The TdCommand object returned will contain the INSERT statement required to insert a row into the table specified in DataAdapter.SelectCommand.CommandText property. The DataAdapter.SelectCommand.CommandText must be a single table SELECT statement. The TdCommandBuilder cannot generate a INSERT statement for a SELECT statement that contains implicit or explicit Joins

Requirements
ProductVersionsPlatforms
.NET2.1, 3.1, 6Windows, Linux, MacOS
.NET Framework4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8Windows
.NET Standard2.0Windows, Linux, MacOS
See Also

Reference

TdCommandBuilder Class
TdCommandBuilder Members
Overload List