Udostępnij za pośrednictwem


Using Type Indicators in Providers

OLE DB defines a standard set of data type indicators for the most commonly used data types. Providers use these data type indicators to tell consumers what data types they support. Each provider maps its own underlying data types to these data type indicators and advertises its support for them through the PROVIDER_TYPES schema rowset. The underlying data types used by the provider are unimportant to the consumer. What is important is that the provider guarantees that it can always safely transfer data in the type represented by the indicator it advertises for a column or parameter. For examples of how various providers might map underlying data types to OLE DB data types, see the following sections.

Providers are not required to support all of the OLE DB data types listed in Type Indicators in Appendix A: Data Types, nor are they required to support all possible conversions among them. For information about what conversions all providers are required to support, see Data Type Conversion.

Although OLE DB attempts to provide a unified type system, it is subject to the following limitations:

  • It does not standardize type names as used in text commands. The TYPE_NAME column in the PROVIDER_TYPES schema rowset contains the type name consumers should use when executing data definition language (DDL) commands. This saves providers from having to parse such commands before passing them to the data source.

  • It exposes data store?specific type names for parameters in text commands. For more information, see ICommandWithParameters::SetParameterInfo in the reference section.