Resources

OLE DB Format Processing:
Applying Informats to Output Operations

The method that you use to apply informats to an output operation is similar to the one that you use to apply formats to an input operation. Specifically, you use the SASFORMAT structure to specify an informat and associate it with a column. You can use the persisted informats or override the default information. (See Determining Persisted Format Information.)

Follow these basic steps to apply informats.

  1. Set the wType member of the SASFORMAT structure to SASFMT_INFORMAT, so that the instance of the structure applies to an informat rather than a format.
  2. Set pwszName to an informat name to override the default, or set to zero (0) or NULL to use the default.
  3. Set iLength to a width to override the default, or set it to zero (0) or NULL to use the default.
  4. Set iDecimals to a decimal value to override the default, or set it to zero (0) or NULL to use the default.
  5. Set the wType member of your DBBINDING structure to one of these OLE DB character types: DBTYPE_STR, DBTYPE_WSTR, or DBTYPE_BSTR. (This is the same as the format setting.)

Binding Columns to Formats and Informats

A column can be bound with both a format and an informat simultaneously. To do this, set the ulExtension member of the DBBINDEXT to 2, and set the pExtension to the address of an array of two SASFORMAT structures. One of the structures in this array should define the format to apply and the other structure should define the informat.

Note: The SAS Data Providers do not validate that format and informat information are paired sensibly on the same column binding. The providers also do not prevent you from binding the same column more than once per accessor, nor do they prevent you from using that accessor on output operations. If you use an accessor in this way and if the accessor you use is not consistent with the operation being performed, you may receive data integrity errors.


See Also:

About Format and Informat Processing with OLE DB
Using the SASFORMAT Structure
Applying Default Formats to Input Operations
Overriding Formats for Input Operations