About Debugging External Procedures

Usually, when an external procedure fails, its C prototype is faulty.

That is, the prototype does not match the one generated internally by PL/SQL. This can happen if you specify an incompatible C data type. For example, to pass an OUT parameter of type REAL, you must specify float *. Specifying float, double *, or any other C data type results in a mismatch.

In such cases, you get a lost RPC connection to external procedure agent error, which means that agent extproc terminated abnormally because the external procedure caused a core dump.

See Also:

Oracle Database Data Cartridge Developer's Guide. for information on how to avoid errors when declaring C prototype parameters

Using Package DEBUG_EXTPROC

To help you debug external procedures, PL/SQL provides the utility package DEBUG_EXTPROC.

To install the package, run the script dbgextp.sql, which you can find in the PL/SQL demo directory.

To use the package, follow instructions in dbgextp.sql. Your Oracle Database account must have EXECUTE privileges on the package and CREATE LIBRARY privileges.

To debug external procedures:

  1. From Windows Task Manager, in the Processes dialog, select ExtProc.exe.
  2. Right click, and select Debug.
  3. Click OK in the message window.

    If you have built your DLL in a debug fashion with Microsoft Visual C++, then Visual C++ is activated.

  4. In the Visual C++ window, select Edit > Breakpoints.

    Use the breakpoint identified in dbgextp.sql in the PL/SQL demo directory.

    See Also: