MDAC 2.5 SDK - OLE DB Programmer's Reference
Chapter 21: OLE DB for OLAP Concepts


 

Delimited Identifiers Returned from the Provider

When the consumer inputs a query string or schema rowset restriction, identifiers need to be quoted. However, there are occasions when a provider returns delimited identifiers, which could be the same quotation marks.

Consumers frequently use the information returned from schema rowsets to formulate a query. For example, the consumer user interface might allow a user to select a set of displayed members and drop them onto an axis of a dataset. When displaying the members, MEMBER_CAPTION is used. The act of dropping the set of members onto an axis triggers a routine in the consumer that formulates an axis specification. Here it will use the MEMBER_UNIQUE_NAME column from the MEMBERS rowset. As discussed in the section "Name Space and Unique Names," one possible way a provider can generate a unique name is by constructing it out of various component names, using a period (.) as the separator between these component names. Such providers should make sure that each component is delimited; otherwise, the query might have trouble parsing.

For example, two cities share the same name: New Albany in New Jersey, USA, and New Albany in Nova Scotia, Canada. If the provider returned the MEMBER_UNIQUE_NAME column of the MEMBERS rowset for these two members without using delimit characters, the returned values would be USA.New Jersey.New Albany and Canada.Nova Scotia.New Albany, respectively. The consumer could put delimit characters around each name: [USA.New Jersey.New Albany] and [Canada.Nova Scotia.New Albany]. However, the provider would be unable to determine the individual components that form the unique name because it is unclear whether the period (.) acts as a separator or is a part of the name. Therefore, the provider should return the MEMBER_UNIQUE_NAME column with each component delimited: [USA].[New Jersey].[New Albany] and [Canada].[Nova Scotia].[New Albany].

A provider that constructs a unique name out of component names should return component-delimited identifiers (that is, each component of a compound identifier should be delimited) in the following places:

Providers are not required to construct unique names by using the "path" to a member (or any other schema object). The provider is free to construct the unique name in any way. Applications should treat a unique name as an opaque string with no structure. For more information, see the section "Name Space and Unique Names" in Chapter 24.