BCP supports transfer of data to and from partitions of tables in ASE. Data can also be copied to and from multiple data files in parallel.
The following section describes changes to BLK_PARTITION for BCP partition support.
To support named BCP partitions in BCP_IN and BCP_OUT operations, Sybase added a new property, BLK_PARTITION. The syntax for blk_props with the new BLK_PARTITION property follows:
blk_props(blkdescr, CS_SET, BLK_PARTITION, partbuf, CS_NULLTERM, NULL);
You must consider the following issues when using BLK_PARTITION:
The partbuf buffer must be a pointer to a character string containing the name of the partition.
Only one name may be provided. A single BLKLIB operation always operates on an entire table or on a single partition. If no partition name is provided, BLKLIB will not operate on a specific partition but on the entire table.
This property can be used for both BCP_IN and BCP_OUT operations, whereas the BLK_SLICENUM property can only be used for BCP_IN. Either BLK_PARTITION or BLK_SLICENUM can be used; if one is set, the other is cleared.
The BLK_PARTITION property does not require you to set CS_VERSION_150 or BLK_VERSION_150.
A new option, partition partition_name, is added to the bcp syntax. The option is the name of the partition in Adaptive Server.
For the latest bcp syntax, see Appendix A, “Utility Commands Reference,” in the Open Client and Open Server 15.0 Programmer’s Supplement for your platform.
For more information on bcp partition support, see these documents:
Open Client and Open Server 15.0 Programmer’s Supplement for your platform
Open Client and Open Server 15.0 Common Libraries Reference Manual