Brought to you by the Oracle Rdb Server Technology Group
To access such a routine, simply define the name and arguments to a routine written in any OpenVMS standard language (even SQL module language routines), using enough information to allow Rdb to pass in and to receive data from the routine. External functions allow only IN parameters, with a single returned value for the function. Typical examples include mathematics routines (SIN, COS, TAN, SQRT, etc), user written business functions, interprocess communication, or specialized logging.
Oracle Rdb7 added support for external procedures that accept both IN and OUT arguments. This allows access to a much large range of existing routines from within the SQL environment.
Technical Tips: Using external routines in Rdb7 to pass parameters to interactive SQL scripts
As a programmer, I have been using OpenVMS for nearly 20 years. As I am very familiar with the rich set of routines in the various runtime libraries provided with this operating system, I tend to reuse existing routines instead of writing my own. I do this by adding an external function or procedure to Oracle Rdb, which usually consists of writing just the SQL interface to one of these routines.
I have often been asked how to pass parameters to SQL script that would drive the queries inside. This month's tip shows how to do this using the OpenVMS runtime library (LIBRTL).
First, we create a set of domains to provide consistent data types: