Transfer process

These steps describe how bulk copy transfer processes data between two databases:

  1. The client application initiates a transfer request.

  2. The DB2 access service receives the transfer request and executes the sourceselectstatement against the source database to retrieve the schema of the result set, including column datatypes, length, precision, and scale.

  3. The DB2 access service queries the target table for a description of the target table columns and compares this information to the structure of the result set for these criteria:

    • The target table must have at least as many columns as the result set.

    • The datatype of each result set column must be convertible to the type of its target column.

    If either of these tests fails, the DB2 access service stops processing the transfer and issues an error message.

  4. If the transfer statement includes the with replace or truncate clause, the DB2 access service deletes data in the target table, if the user ID of the person executing the request is authorized to do so. If the user ID is not authorized, the transfer fails.

  5. The DB2 access service maps the columns from the result set to the columns in the target table in the order in which they appear. The DB2 access service attempts to insert NULL values (if allowable) in all columns in the target table that do not have corresponding columns in the result set.

  6. The DB2 access service prepares an insert or equivalent bulk load statement for execution against the target table.

  7. If conversion errors occur as rows are inserted (for example, a value is out of range), the invalid rows are handled according to the values set in the following properties:

    • CharConvertError

    • NumConvertError

    • DatetimeConvertError

    • DefaultDate

    • DefaultTime

    • DefaultNum

  8. The transfer continues processing. If the SendWarningMessages property is set to yes, the DB2 access service sends a warning message to the client application.