A server-side routine, sends text, image, sensitivity, or boundary data in a formatted bulk-copy row obtained from blk_getrow.
CS_RETCODE blk_sendtext(blkdesc, row, buffer, buflen) CS_BLKDESC *blkdesc; CS_BLK_ROW *row; CS_BYTE *buffer; CS_INT buflen;
A pointer to the CS_BLKDESC that is serving as a control block for the bulk-copy operation. blk_alloc allocates a CS_BLKDESC structure.
A pointer to a CS_BLK_ROW structure. The CS_BLK_ROW structure is a hidden structure that holds formatted bulk-copy rows sent from the client. A gateway application can fill in a CS_BLK_ROW structure with a formatted row by calling the blk_getrow routine.
A pointer to the space from which blk_sendtext picks up the chunk of text, image, sensitivity, or boundary data.
The length, in bytes, of the *buffer data space.
blk_sendtext returns:
Returns |
Indicates |
---|---|
CS_SUCCEED |
The routine completed successfully. |
CS_FAIL |
The routine failed. |
CS_PENDING |
Asynchronous network I/O is in effect. See the “Asynchronous Programming” topics page in the Open Client Client-Library/C Reference Manual. |
blk_sendtext is a client-side routine.
A gateway application uses blk_sendtext in conjunction with blk_gettext. Together, the two routines enable a gateway application to receive chunks of text, image, sensitivity, or boundary data in formatted bulk-copy rows from an Open Client application and send them on to Adaptive Server Enterprise.
blk_sendtext is a gateway-specific substitute for blk_textxfer. An application can call blk_sendtext only after calling blk_gettext to retrieve a chunk of text, image, sensitivity, or boundary data belonging to a formatted row.
The sequence of calls in the gateway application is:
blk_getrow, to pick up a formatted bulk-copy row
blk_sendrow, to send the formatted row to Adaptive Server Enterprise
If blk_sendrow returns CS_BLK_HAS_TEXT, the application must call the following routines in a loop, until blk_gettext returns CS_END_DATA:
blk_gettext, to pick up a chunk of text, image, sensitivity, or boundary data
blk_sendtext, to send a chunk of text, image, sensitivity, or boundary data
Only one blk_gettext/blk_sendtext loop is required, no matter how many text, image, sensitivity, or boundary columns are being transferred.