Invoking 32-bit routines on a 64-bit database server

In 64-bit database instances, it is possible to invoke C and COBOL routines that reference 32-bit external routine libraries, however these routines must be specified to run as fenced and not threadsafe.

About this task

This is done by including both the FENCED clause and NOT THREADSAFE clause in the routine CREATE statement when creating a new routine. For routines that have already been created in the 64-bit instance, the ALTER FUNCTION or ALTER PROCEDURE statements can be used to modify the routine definition. The first time such a 32- bit routine is invoked in a 64- environment, there will be a performance degradation. Subsequent invocations of the 32-bit stored procedure will perform as well as an equivalent 64-bit routine. Use of 32-bit routines in 64-bit database instances is discouraged.

To successfully invoke Java™ procedures in a 64-bit database instance on a 64-bit database server, a 64-bit Java Virtual Machine (JVM) is required. 32-bit JVMs are not supported for running routines in 64-bit database instances. As Java classes are platform independent, a Java class compiled with a 32-bit software development kit can run successfully with a 64-bit JVM. Routine performance is not impacted by doing this.

Procedure

To invoke existing 32-bit routines on a 64-bit server:

  1. Copy the routine class or library to the database routines directory:
    • Linux® and UNIX: sqllib/function
    • Windows: sqllib\function
  2. Register the stored procedure with the CREATE PROCEDURE statement.
  3. Invoke the stored procedure with the CALL statement.