DB2 Version 9.7 for Linux, UNIX, and Windows

DB2BulkCopy.DestinationTableName Property

Name of the destination table on the server, where rows from the data source will be copied.

Namespace:
IBM.Data.DB2
Assembly:
IBM.Data.DB2 (in IBM.Data.DB2.dll)

Syntax

[Visual Basic]
Public Property DestinationTableName As String
[C#]
public string DestinationTableName {get; set;}
[C++]
public: __property String* get_DestinationTableName();
public: __property void set_DestinationTableName(String*);
[JScript]
public function get DestinationTableName() : String;
public function set DestinationTableName(String);

Property value

The string value of the destination table's name.

Remarks

A DestinationTableName must be set for the WriteToServer operation to be successful. If case sensitivity needs to be maintained for the destination table name, you need to enclose the destination table name in an extra set of double quotes. For example:
salesCopy.DestinationTable = "\"CanadaSales\""; 

The value you provide for DestinationTableName can optionally include the database name and the schema name, in addition to the mandatory table name. For example: SAMPLE.USER.SALES.

Example

[C#] The following example demonstrates a bulk copy of data from a DataTable source into the SALES table.

[C#]
public static void copyIntoSales(DB2Connection conn, DataTable source)
{
  DB2BulkCopy salesCopy = new DB2BulkCopy(conn);
  salesCopy.DestinationTableName = "SALES";

  try
  {
    salesCopy.WriteToServer(source);
    salesCopy.Close();
  }
  catch (Exception ex)
  {
    MessageBox.Show(ex.ToString(), "Exception");
  }
}

Version information

Last update
This topic was last updated for: IBM DB2 Version 9.7
.NET Framework version
Supported in: 2.0, 3.0, 3.5 and 4.0
IBM Data Server Client
Supported in: IBM® DB2® Version 9 through Version 9.7