Delimited Identifiers

OLE DB Programmer's Reference

When used in the context of a DBMS, identifier denotes any object name that appears in the schema. For example, the cube name is an identifier, as is the dimension name, hierarchy name, level name, member name, property name, and so on.

Many provider implementations allow special characters in an identifier, such as the space character in the member name "Microsoft Office." Certain providers also allow language keywords to be used as object names. However, it is better to avoid this because the presence of such identifiers can easily disrupt a parser. In the following example, an MDX statement generates a syntax error because the text Microsoft Office.Children cannot be parsed:

SELECT Microsoft Office.Children ON COLUMNS, Quarters.MEMBERS ON ROWS FROM SalesCube

In this statement, the COLUMNS axis was intended to include all the children of the member Microsoft Office. The code needs a way to delimit the identifier "Microsoft Office." To do this, use delimit characters, which are special characters that enclose the identifier and give the parser the ability to treat everything between the delimit characters as a single token. Typically, the square bracket characters ([ ]) are used to delimit the quotation. By using square brackets as the delimit characters, the earlier expression can be rewritten as follows:

SELECT [Microsoft Office].Children ON COLUMNS, Quarters.MEMBERS ON ROWS FROM SalesCube

Now the preceding statement can be parsed unambiguously.

Delimited identifiers should be used when sending MDX statements to the provider. They should also be used when restricting schema rowsets. Consumers, especially those working with multiple data stores, are strongly encouraged to delimit all identifiers used in an MDX statement or in a schema rowset restriction.

1998-2001 Microsoft Corporation. All rights reserved.



Microsoft Ole Db 2.0 Programmer's Reference and Data Access SDK
Microsoft OLE DB 2.0 Programmers Reference and Data Access SDK (Microsoft Professional Editions)
ISBN: 0735605904
EAN: 2147483647
Year: 1998
Pages: 1083

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net