"Use Library" is to be executed as a MDX statement, prior to the MDX
query that references the library:
http://groups-beta.google.com/group/...rver.olap/msg/
365f63407543edb8
Quote:
|
With some help from Microsoft I realized what was
|
a basic misunderstanding.
You can not use "USE LIBRARY" in the same script as your MDX query.
You have to execute it by itself first then execute the query that
references the external library. I was trying to do both in the same
batch.
Here is some MSDN info on external libraries - they can also be
registered via Cube Calculated Member Builder:
http://msdn.microsoft.com/library/de.../en-us/olapdma
d/agmdxnonosfunct_3bzn.asp
Quote:
|
Creating and Using User-Defined Functions in MDX
|
...
USE LIBRARY Statement
Before employing a user-defined function in an MDX statement, however,
the external library that contains the user-defined function must first
be loaded into memory. Loading an external library is performed with the
USE LIBRARY statement.
All user-defined functions must be associated with a Component Object
Model (COM) class in order to be used, usually supplied in the form of a
Microsoft ActiveX® dynamic link library (DLL).
If, for example, the user-defined function is part of an ActiveX DLL
named MyFunc.dll, located in the C:\Winnt\System path, you can use the
USE LIBRARY statement to load it by the library name, as demonstrated
here:
USE LIBRARY "C:\WINNT\SYSTEM\MyFunc.dll"
The USE LIBRARY statement can also load user-defined functions by class
name, as each class must be registered in order to work correctly. So,
if your example function is located in the example ActiveX DLL and
associated with the class "MyFuncClass", the library can be loaded using
the following example:
USE LIBRARY "MyFunc.MyFuncClass"
This method is recommended when referring to libraries that may be in
different locations on different servers. As ActiveX DLL components must
be registered on server and client machines, referring to the class name
ensures that the library is loaded from the correct location, regardless
of that location.
Multiple libraries can be loaded at the same time with a single USE
LIBRARY statement, by separating the library names or class names with
commas, as demonstrated here:
USE LIBRARY "C:\WINNT\SYSTEM\MyFunc.dll", "C:\WINNT\SYSTEM\NewFuncs.dll"
A USE LIBRARY statement with no parameters unregisters all function
libraries except the Microsoft SQL Server™ 2000 Analysis Services
function library.
...
- Deepak
Deepak Puri
Microsoft MVP - SQL Server
*** Sent via Developersdex http://www.developersdex.com ***