blk_props

Description

Sets or retrieves bulk-descriptor structure properties.

Syntax

CS_RETCODE blk_props(blkdesc, action, property,
                  buffer, buflen, outlen)
 
 CS_BLKDESC      *blkdesc;
 CS_INT                 action;
 CS_INT                 property;
 CS_VOID              *buffer;
 CS_INT                 buflen;
 CS_INT               *outlen;

Parameters

blkdesc

A pointer to a CS_BLKDESC structure. A bulk-descriptor structure contains information about a bulk-copy operation. blk_alloc allocates a bulk-descriptor structure.

action

One of the following symbolic constants:

Value of action

blk_props

CS_SET

Sets the value of the property

CS_GET

Retrieves the value of the property

CS_CLEAR

Clears the value of the property by resetting it to its default value

property

A symbolic constant that indicates the property of interest. Table 4-6 lists valid property constants and describes each property.

buffer

If a property value is being set, buffer points to the value to use in setting the property.

If a property value is being retrieved, buffer points to the space in which blk_props will place the requested information.

The C datatype of the value depends on the property. Refer to Table 4-6 for the datatype of the property of interest.

buflen

Generally, buflen is the length, in bytes, of *buffer.

If a property value is being set and the value in *buffer is null-terminated, pass buflen as CS_NULLTERM.

If *buffer is a fixed-length or symbolic value, pass buflen as CS_UNUSED.

outlen

A pointer to an integer variable.

If a property value is being set, outlen is not used and should be passed as NULL.

If a property value is being retrieved and outlen is supplied, blk_props sets *outlen to the length, in bytes, of the requested information.

If the information is larger than buflen bytes, an application can use the value of *outlen to determine how many bytes are needed to hold the information.

Returns

blk_props returns:

Returns

Indicates

CS_SUCCEED

The routine completed successfully.

CS_FAIL

The routine failed.

Usage

Table 4-6: Client/Server bulk descriptor properties

Property name

Description

*buffer is

Applies to

Notes

BLK_CONV

Character-set conversion performed by client.

CS_TRUE or CS_FALSE.

IN copies only

To disable character-set conversion on the current server connection, set CS_NOCHARSETCNV_REQD to CS_TRUE. For more information, see the ct_con_props section in the Open Client Client-Library/C Reference Manual.

BLK_IDENTITY

Whether values for a table’s identity column are specified explicitly for each row to be inserted.

This property cannot be set to CS_TRUE if BLK_IDSTARTNUM has been set for a bulk-copy-in operation.

CS_TRUE or CS_FALSE.

The default is CS_FALSE, which indicates that identity values are either:

  • Computed from the starting value indicated by BLK_IDSTARTNUM, or

  • Computed by Adaptive Server as data is inserted, based on existing identity values in the table.

IN copies only

BLK_IDSTARTNUM

The starting value for identity columns in inserted rows. The first inserted row uses this value, and the value is incremented for each subsequent row.

This property cannot be set if BLK_IDENTITY has been set to CS_TRUE for the bulk-copy-in operation.

A CS_NUMERIC variable containing the starting identity value.

There is no default.

IN copies only

BLK_NOAPI_CHK

Whether parameter and error checking for illegal parameter values and state transitions are disabled for Bulk-Library calls.

CS_TRUE or CS_FALSE.

The default is CS_FALSE, which means error checking is performed.

Both IN and OUT copies

BLK_PARTITION

Property to support BCP partitions for BCP_IN and BCP_OUT operations.

A character string containing the name of the partition.

Both IN and OUT copies

BLK_SENSITIVITY_ LBL

Whether a table’s sensitivity column is included in the bulk-copy operation.

CS_TRUE or CS_FALSE (default).

Both IN and OUT copies

Secure Adaptive Server only

BLK_SLICENUM

For bulk-copy into a partitioned table. Specifies the partition number that copied rows are inserted to.

A CS_INT variable containing a positive value representing the partition number.

The default is CS_UNUSED, which indicates that Adaptive Server will randomly choose a partition number.

IN copies only


BLK_IDENTITY property


BLK_NOAPI_CHK property


BLK_SENSITIVITY_LBL property


BLK_PARTITION property

See also

blk_alloc, blk_init