Server-side routine retrieves the text, image, sensitivity, or boundary portion of an incoming formatted bulk-copy row.
CS_RETCODE blk_gettext(srvproc,blkdescp, rowp, bufp, bufsize, outlenp)
SRV_PROC *srvproc; CS_BLKDESC *blkdescp; CS_BLK_ROW *rowp; CS_BYTE *bufp; CS_INT bufsize; CS_INT *outlenp;
A pointer to the SRV_PROC structure associated with the client sending the bulk-copy row. This structure contains all the information that Server-Library uses to manage communications and data between the Open Server application and the client.
A pointer to a CS_BLKDESC structure containing information about bulk-copy data. This structure must have been previously allocated with a call to blk_alloc and initialized with a call to blk_init. This structure is used to interpret incoming formatted bulk-copy rows.
A pointer to the formatted bulk-copy row read from the client through a prior call to blk_getrow.
The CS_BLK_ROW structure is a hidden structure that holds formatted bulk-copy rows sent from the client.
A pointer to the application buffer in which Bulk-Library places the text, image, sensitivity, or boundary data.
The size, in bytes, of the space pointed at by bufp.
A pointer to a CS_INT variable, which is set to the number of bytes actually read by blk_gettext. It may be less than bufsize. To determine whether all of the text, image, sensitivity, or boundary part of the row has been read, check for a return code of CS_END_DATA. An *outlenp value that is less than bufsize does not necessarily indicate the end of a row. For example, it could indicate the end of a text, image, sensitivity, or boundary column that is not the last column in the row.
blk_gettext returns:
Returns |
Indicates |
---|---|
CS_SUCCEED |
The routine completed successfully. |
CS_END_DATA |
There are no more text, image, sensitivity, or boundary fields for the current incoming bulk-copy row. Call blk_getrow to get the next bulk-copy row. |
CS_FAIL |
The routine failed. |
blk_gettext is a server-side routine that is useful in gateway applications.
This routine is used with blk_getrow and blk_colval to receive formatted bulk-copy rows and route them to an Adaptive Server Enterprise. This routine retrieves the text, image, sensitivity, or boundary portions of the row.
Bulk-copy rows are formatted so that all text, image, sensitivity, and boundary fields occur at the end of the row, after all the other types of fields. To route a row to an Adaptive Server Enterprise, first call blk_getrow to retrieve all the parts of the row containing other types of fields. Then, call blk_colval to retrieve and store portions of the row containing other types of fields. Decide where this data goes and send it to the remote server, using blk_sendrow. Call blk_gettext to copy text, image, sensitivity, or boundary data into an application buffer. Finally, call blk_sendtext to send this information to the remote server.
If an incoming bulk-copy row has any text, image, sensitivity, or boundary fields, blk_getrow returns CS_BLK_HAS_TEXT.
It is not an error to call blk_gettext if the row contains no text, image, sensitivity, or boundary fields. The routine simply returns CS_END_DATA.
This routine must be called after blk_getrow. Also, it must be called until it returns CS_END_DATA, to fully read in a bulk-copy row.
Before rows can be sent to a server, the gateway application must have set up the bulk-copy operation with a call to blk_init.
It is critical that the table for which the bulk-copy operation was initialized and the table into which the client is bulk copying are the same table.