Managing External Libraries

Each external library is loaded the first time a UDF that requires it is invoked. A loaded library remains loaded for the life of the server. It is not loaded when a CREATE FUNCTION or CREATE PROCEDURE call is made, nor is it automatically unloaded when a DROP FUNCTION or DROP PROCEDURE call is made.

If the library version must be updated, the dbo.sa_external_library_unload procedure forces the library to be unloaded without restarting the server. The call to unload the external library is successful only if the library in question is not currently in use. The procedure takes one optional parameter, a long varchar, that specifies the name of the library to be unloaded. If no parameter is specified, all external libraries not in use are unloaded.

Note: Unload existing libraries from a running SAP Sybase IQ server before replacing the dynamic link library. The server may fail, if you do not unload the library. Before replacing a dynamically linkable library, either shut down the SAP Sybase IQ server or use the sa_external_library_unload function to unload the library.
For Windows, unload an external function library using:
call sa_external_library_unload('library.dll')
For UNIX, unload an external function library using:
call sa_external_library_unload('library.so')

If a registered function uses a complete path, for example, /abc/def/library, first unregister the function.

In Windows, use
call sa_external_library_unload('\abc\def\library.dll')
In UNIX, use
call sa_external_library_unload('/abc/def/library.so')
Note: The library path is required in the SQL function declaration only if the library is not already located within a directory in the library load path.