Write the routine
The source for an external routine resides in a separate
text file. For information about C UDRs, refer to the HCL OneDB™
DataBlade® API Programmer's
Guide and the HCL OneDB
DataBlade API Function
Reference. For
information about Java™ UDRs,
refer to the HCL® J/Foundation Developer's
Guide.
Tip: It is recommended
that you use the
DataBlade
Developers Kit (DBDK) to
help write UDRs. DBDK enforces standards that facilitate migration
between different versions of the database server.
Because
external-language routines are external to the database, you must
compile the UDR source code and store it where the database server
can access it when the routine is invoked. To prepare UDR source code:
- Compile the C-language UDR and store the executable version in
a shared-object file.
For information about how to create shared-object files, refer to the HCL OneDB DataBlade API Programmer's Guide.
- Compile the Java-language UDR and store the executable version
in a .jar file.
For information about how to prepare .jar files, refer to your Java documentation.
You must install shared object files and .jar files on all database servers that need to run the UDRs, including database servers involved in Enterprise Replication (ER) and High-Availability Data Replication (HDR). The shared object files and .jar files need to be installed under the same absolute path name.