Write the routine

The source for an external routine resides in a separate text file. For information about C UDRs, refer to the Informix® DataBlade® API Programmer's Guide and the Informix DataBlade API Function Reference. For information about Java™ UDRs, refer to the J/Foundation Developer's Guide.

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 Informix 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.