Oracle 8i Data Cartridge Developer's Guide
Release 2 (8.1.6)

Part Number A76937-01





Go to previous page Go to beginning of chapter Go to next page

Methods: Using C/C++ and Java , 11 of 13

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 datatype. For example, to pass an OUT parameter of type REAL, you must specify float *. Specifying float, double *, or any other C datatype will result in a mismatch.

In such cases, you might 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. To avoid errors when declaring C prototype parameters, refer to Table 4-2


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 the instructions in dbgextp.sql. Your Oracle account must have EXECUTE privileges on the package and CREATE LIBRARY privileges.


DEBUG_EXTPROC works only on platforms with debuggers that can attach to a running process. 

Debugging C Code in DLLs on Windows NT Systems

If you are developing on a Windows NT system, you may perform the following additional actions to debug external procedures:

  1. Invoke the Windows NT Task Manager (press Ctrl+Alt+Del.and select Task Manager).

  2. In the Processes display, select ExtProc.exe.

  3. Right click, and select Debug.

  4. Select OK in the message box.

    At this point, if you have built your DLL in a debug fashion with Microsoft Visual C++, Visual C++ is activated.

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

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

Go to previous page Go to beginning of chapter Go to next page
Copyright © 1996-2000, Oracle Corporation.

All Rights Reserved.