14 External Procedures

This chapter describes how to create an environment on BS2000, where external procedure calls can operate. It complements the chapter about External Procedures in the Oracle Database Development Guide.

Loading External Procedures

This section complements the corresponding part in Oracle Database Development Guide.

Perform the following steps to load external procedures:

  1. Set up the environment.

    An external procedure does not run in the same process and address space as the caller. Oracle creates separate processes for them to operate in a safe and secure manner. Oracle Net Services features are used for this purpose. The user must provide appropriate Oracle Net Services parameter files. An example of how this works is documented in this section.

    The listener.ora file must have the following entry:

    (SID_DESC = (SID_NAME = ep_agt1)
                (ENVS = EXTPROC_DLLS=ANY)
                (ORACLE_SID = sid_of_your_database)
                (PROGRAM = EXTPROC)
    )
    

    The tnsnames.ora file must have the following entry:

    extproc_connection_data = (DESCRIPTION =(ADDRESS =(PROTOCOL=ipc)
    (KEY = sid_of_your_database)(CONNECT_DATA =(PRESENTATION=RO)
    (SID = ep_agt1)))
    

    Now, you can start a listener.

    See Also:

  2. Identify the DLL.

    A DLL in the BS2000 environment is a BS2000 LMS library containing the functions called as external procedures. When EXTPROC is loaded, these functions are dynamically linked to the program.

    Use the following command to identify your library to Oracle:

    CREATE LIBRARY my_c_library AS '$myuserid.my-modlib';

    The external C routine must be compiled and the generated LLM must be stored in the LMS library. If you set the MODULE-PROPERTIES option LOWER-CASE-NAMES=*NO, during compilation with the BS2000 C compiler CPP, then all lowercase letters in the entry names are converted to uppercase.

    Also, if you set the MODULE-PROPERTIES option SPECIAL-CHARACTERS=*CONVERT-TO-DOLLAR, then all underscores (_) in the entry names are converted to dollar signs ($), which must be considered when publishing the external procedure.

  3. Publishing and running external procedures are similar to the description in Oracle Database Development Guide. You can find the result messages about the execution of the external procedure in the L.sid.EXTP.SYSOUT.tsn file.