dbTalk Databases Forums  

USE Library

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss USE Library in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
popol
 
Posts: n/a

Default USE Library - 04-06-2005 , 05:13 AM






Hi,
Please can somebody help me with external function.

I am sure that this question has been asked a few times but I am absolutely
lost.

Where do I need to enter the "USE LIBRARY "nameLibrary".
A little example would be welcome.

Thank You


Reply With Quote
  #2  
Old   
Deepak Puri
 
Posts: n/a

Default Re: USE Library - 04-06-2005 , 05:45 PM






"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.
Quote:

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.
...
Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.