blk_drop

Description

Deallocates a CS_BLKDESC structure.

Syntax

CS_RETCODE blk_drop(blkdesc)
 
 CS_BLKDESC      *blkdesc;

Parameters

blkdesc

A pointer to a CS_BLKDESC previously allocated through blk_alloc.

Returns

blk_drop returns:

Returns

Indicates

CS_SUCCEED

The routine completed successfully.

CS_FAIL

The routine failed.

Examples

Example 1

/*
 ** BulkCopyIn()
 */
 
 CS_STATIC CS_RETCODE 
 BulkCopyIn(connection)
 CS_CONNECTION   *connection;
  {
 
 CS_BLKDESC   *blkdesc;
 CS_DATAFMT   datafmt;      /* variable descriptions */
 Blk_Data     *dptr;        /* data for transfer */
 CS_INT       datalen[5];   /* variable data length */
 CS_INT       len;

 CS_INT       numrows;
 
 /*
 ** Ready to start the bulk copy in now that all the
 ** connections have been made and have a table name.
 ** Start by getting the bulk descriptor initializing. 
 */
 ...CODE DELETED.....
 
 /*
 ** Now to bind the variables to the columns and
 ** transfer the data
 */
 ...CODE DELETED.....
 
 /* ALL the rows sent so clear up */
 if (blk_done(blkdesc, CS_BLK_ALL, &numrows) == CS_FAIL)
 {
      ex_error("BulkCopyIn: blk_done() failed");
      return CS_FAIL;
 }
 if (blk_drop(blkdesc) == CS_FAIL)
 {
      ex_error("BulkCopyIn: blk_drop() failed");
      return CS_FAIL;
 }
 
 return CS_SUCCEED;
 }

Usage

See also

blk_alloc, blk_done