The bulk-copy-out process

A typical application follows these steps to perform a bulk-copy-out operation:

  1. Calls ct_con_props to set the required properties to open the connection.

  2. Calls ct_connect to open the connection.

  3. Calls blk_alloc to allocate a bulk-descriptor structure.

  4. For each column of interest, the application:

  5. Transfers the data by calling blk_rowxfer_mult in a loop:

    The application calls blk_rowxfer_mult repeatedly to transfer each row to program variables until blk_rowxfer_mult returns CS_END_DATA.

    If the row contains columns whose data is transferred in chunks, the application calls blk_textxfer in a loop for each column. Data being transferred via blk_textxfer must reside at the end of the row, following any bound columns.

    For example, suppose an application bulk-copies columns 1, 3, 5, 7, and 9 and must call blk_textxfer to copy columns 7 and 9. The application calls blk_bind once for each column, passing buffer as NULL for columns 7 and 9. After calling blk_rowxfer_mult to transfer a row from the table, the application must call blk_textxfer in a loop to copy the data for column 7 and then call blk_textxfer in another loop to copy the data for column 9.

  6. Calls blk_done(CS_BLK_ALL) to indicate that the bulk-copy operation is complete.

  7. Calls blk_drop to deallocate the bulk-descriptor structure.

NoteAn application can call blk_bind between calls to blk_rowxfer_mult to specify different program variable address or length.