GetBulkOperation (Salesforce driver only)
- Last Updated: August 19, 2019
- 1 minute read
- DataDirect Connectors
- ODBC
- Aha! 8.0
- Amazon Redshift 8.0
- Apache Cassandra 8.0
- Apache Hive 8.0
- Apache Spark SQL 8.0
- Autonomous Rest Connector 8.0
- Cloudera Impala 7.1
- dBase 7.1
- + 24
Syntax
SQLReturn
GetBulkOperation (HDBC hdbc,
SQLULEN Operation)
The standard ODBC return codes are returned: SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_INVALID_HANDLE, and SQL_ERROR.
Purpose
Returns the bulk operation currently set on the connection. The bulk operation specifies the operation to be performed when either the LoadTableFromFile or LoadTableFromFileW method is called.
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 then use the standard ODBC function SQLGetInfo (ODBC Conn Handle, SQL_DRIVER_HDBC).
- Operation
- is a pointer to the location where current bulk operation specified for the connection is returned. The returned value is one of the operation values defined by SetBulkOperation.
Example
HDBC hdbc;
HENV henv;
void *driverHandle;
HMODULE hmod;
PGetBulkOperation getBulkOperation;
SQLULEN bulkOperationType;
/* 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);
}
/* Get the current value for bulk operation. */
getBulkOperation = (PGetBulkOperation)
resolveName (hmod, "GetBulkOperation");
if (! getBulkOperation) {
printf ("Cannot find GetBulkOperation!\n");
exit (255);
}
rc = (*getBulkOperation) (
driverHandle,
&bulkOperationType);
if (rc == SQL_SUCCESS) {
printf ("Current bulk operation is: %u.\n", bulkOperationType);
}
else {
driverError (driverHandle, hmod);
}
/* */