Delimited Identifiers Returned from the Provider

This discussion so far has been about the need for quoting identifiers when the consumer inputs a query string or schema rowset restriction. This section will discuss when and why a provider returns delimited identifiers.

Consumers frequently use the information returned from schema rowsets to formulate a query. For example, the consumer user interface may 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 mentioned 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, with the period (.) as the separator between these component names. Such providers should make sure that each component is delimited; otherwise, the query may have trouble parsing.

An example will make this clearer. There is a city called New Albany in New Jersey, USA, and also one in Nova Scotia, Canada. If the provider returned the MEMBER_UNIQUE_NAME column of the MEMBERS rowset for these two members without quoting, the returned values will be USA.New Jersey.New Albany and Canada.Nova Scotia.New Albany, respectively. The consumer can put delimit characters around the entire name — [USA.New Jersey.New Albany] and [Canada.Nova Scotia.New Albany]. However, the provider will be unable to find out 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. To get around these problems, 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 is delimited) in the following places:

Note that 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 this chapter.