Remove routines from the shared library
- You drop all routines in the module.
- All instances of the routines finish executing.
- You explicitly call ifx_unload_module.
Once these conditions are true, the database server automatically unloads the shared-object file from memory. It also puts a message in the log file to indicate that the shared object is unloaded. Once the shared object is unloaded, you can replace the shared-object file on disk and reregister its UDRs in the database.
onstat -g dll
Do not overwrite a shared-object file on disk while it is loaded in memory because you might cause the database server to generate an error when the overwritten module is accessed or unloaded. Use the ifx_replace_module() function to replace a loaded shared object file with a new version. For information about the ifx_replace_module() function, see the description of Function Expressions within the Expression segment in the HCL OneDB™ Guide to SQL: Syntax.
EXECUTE FUNCTION
ifx_replace_module("/usr/apps/opaque_types/circle.so",
"/usr/apps/shared_libs/circle.so", "c")
- Zero indicates success.
- A negative value indicates an error message number.
SELECT
ifx_replace_module("/usr/apps/opaque_types/circle.so",
"/usr/apps/shared_libs/circle.so", "c")
FROM customer
WHERE customer_id = 100
If you do not want the shared library replaced multiple times with this SELECT statement, ensure that the SELECT statement returns only one row of values.
When you execute these functions from within an ESQL/C application, you must associate the EXECUTE FUNCTION statement with a function cursor. For more information about writing applications, refer to the HCL OneDB ESQL/C Programmer's Manual.