The standard ODBC return codes are returned: SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_INVALID_HANDLE, SQL_NO_DATA, and SQL_ERROR.
Purpose
Specifies the bulk operation to be performed when either the LoadTableFromFile and LoadTableFromFileW method is called. The bulk operation remains set until SetBulkOperation is called again. When a connection is established, the initial bulk operation is BULK_OPERATION_INSERT.
Parameters
hdbc
is the driver’s connection handle, which is not the handle returned by SQLAllocHandle or SQLAllocConnect. To obtain the driver's connection handle, the application must use SQLGetInfo (ODBC Conn Handle,SQL_DRIVER_HDBC).
Operation
is an integer value that specifies the bulk operation to set on the connection. It can have one of the following values:
1 - BULK_OPERATION_INSERT
2 - BULK_OPERATION_UPDATE
3- BULK_OPERATION_DELETE
4 - BULK_OPERATION_UPSERT
Example
HDBC hdbc;
HENV henv;
void *driverHandle;
HMODULE hmod;
PSetBulkOperation setBulkOperation;
/* Get the driver's connection handle from the DM. This handle must be used when calling directly into the driver. */
rc = SQLGetInfo (hdbc, SQL_DRIVER_HDBC, &driverHandle, 0, NULL);
if (rc != SQL_SUCCESS) {
ODBC_error (henv, hdbc, SQL_NULL_HSTMT);
EnvClose (henv, hdbc);
exit (255);
}
/* Get the DM's shared library or DLL handle to the driver. */
rc = SQLGetInfo (hdbc, SQL_DRIVER_HLIB, &hmod, 0, NULL);
if (rc != SQL_SUCCESS) {
ODBC_error (henv, hdbc, SQL_NULL_HSTMT);
EnvClose (henv, hdbc);
exit (255);
}
/* Set the Bulk Operation type to DELETE. Any subsequent call to LoadTableFromFile(W) will result in a bulk delete of the rows specified. */