9 DataDirect Bulk Load : DataDirect Bulk Load Statement Attributes

DataDirect Bulk Load Statement Attributes
In addition to exporting tables with the ExportTableToFile methods, result sets can be exported to a bulk load data file through the use of two DataDirect statement attributes, SQL_BULK_EXPORT_PARAMS and SQL_BULK_EXPORT. SQL_BULK_EXPORT_PARAMS is used to configure information about where and how the data is to be exported. SQL_BULK_EXPORT begins the bulk export operation.
SQL_BULK_EXPORT_PARAMS
The ValuePtr argument to SQLSetStmtAttr or SQLSetStmtAttrW when the attribute argument is SQL_BULK_EXPORT_PARAMS is a pointer to a BulkExportParams structure. The definitions of the fields in the BulkExportParams structure are the same as the corresponding arguments in the ExportTableToFile and ExportTableToFileW methods except that the generation of the log file is controlled by the EnableLogging field. When EnableLogging is set to 1, the driver writes events that occur during the export to a log file. Events logged to this file are:
The log file is located in the same directory as the bulk load data file and has the same base name as the bulk load data file with a .log extension. When EnableLogging is set to 0, no logging takes place
If the bulk export parameters are not set prior to setting the SQL_BULK_EXPORT attribute, the driver uses the current driver code page value, defaults EnableLogging to 1 (enabled), and defaults ErrorTolerance and WarningTolerance to -1 (infinite).
The SQL_BULK_EXPORT_PARAMS structure is as follows:
struct BulkExportParams {
  SQLLEN  Version;               /* Must be the value 1 */
  SQLLEN  IANAAppCodePage;
  SQLLEN  EnableLogging;
  SQLLEN  ErrorTolerance;
  SQLLEN  WarningTolerance;
};
SQL_BULK_EXPORT
The ValuePtr argument to SQLSetStmtAttr or SQLSetStmtAttrW when the attribute argument is SQL_BULK_EXPORT is a pointer to a string that specifies the file name of the bulk load data file to which the data in the result set will be exported.
Result set export occurs when the SQL_BULK_EXPORT statement attribute is set. If using the SQL_BULK_EXPORT_PARAMS attribute to set values for the bulk export parameters, the SQL_BULK_EXPORT_PARAMS attribute must be set prior to setting the SQL_BULK_EXPORT attribute. Once set, the bulk export parameters remain set for the life of the statement. If the bulk export parameters are not set prior to setting the SQL_BULK_EXPORT attribute, the driver uses the current driver code page value, defaults EnableLogging to 1 (enabled), and defaults ErrorTolerance and WarningTolerance to -1 (infinite)
Both a bulk load data file and a bulk load configuration file are produced by this operation. The configuration file has the same base name as the bulk load data file, but with an XML extension. The configuration file is created in the same directory as the bulk load data file.