Executing external C programs from PL/SQL
Oracle extends the architectural support to the external programs in C, C++, Java, or the one whose library is interpretable by C. In the external procedure architecture, we saw the processing steps of an external program. Now, we will list the development steps to run a C program from PL/SQL:
Write a C program and compile it.
Copy the C program's code file in the
$ORACLE_HOME\bin\
directory. Generate the DLL using a hardware supported native C compiler.Tip
For demonstration purposes, we will use the MingW (Minimal GNU for Windows) compiler to compile C program and generate the DLLs.
It can be downloaded from http://www.mingw.org/wiki/Getting_Started.
Configure the Oracle Net service.
Create a PL/SQL library object for the DLL.
Create a call specification in PL/SQL to publish the external program. Specify the external language used in the program (here, it is C), the PL/SQL library name, the method in the external program and the parameters mapped as per...