Skip to Main Content
Oracle in a Nutshell
book

Oracle in a Nutshell

by Rick Greenwald, David C. Kreines
December 2002
Intermediate to advanced content levelIntermediate to advanced
928 pages
85h 29m
English
O'Reilly Media, Inc.
Content preview from Oracle in a Nutshell

External Procedures

External procedures provide a mechanism for calling a nondatabase program (such as a DLL under Windows or a shared library under Unix) from a PL/SQL program. Every session calling an external procedure will have its own extproc process started by the listener. This extproc process is started with the first call to the external procedure and terminates when the session exits. The shared library needs to have a corresponding library created for it in the database.

The following is a brief summary of the steps you need to follow in order to create an external procedure. For details and examples of external procedures, see Chapter 23 in Oracle PL/SQL Programming, 3rd Edition.

  1. Set up the listener.

    External procedures require a listener. If you are running an Oracle Net Services listener, that listener can be used as the extproc listener as well, although you may increase security by separating it from the external procedure listener and launching it from an account that has more limited privileges. See the Oracle9i Administrators’ Guide or the Oracle9i Net Services Administrators’ Guide for the details on configuring your listener.

  2. Identify or create the shared library or DLL.

    This step has nothing to do with PL/SQL and may or may not have anything to do with the database. You must write your own C routines and link them into a shared library/DLL or use an existing library’s functions or procedures. The simple example shown later will use the existing random number-generating ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Oracle Internals

Oracle Internals

Donald K. Burleson
Oracle PL/SQL

Oracle PL/SQL

Lewis Cunningham
Oracle Essentials: Oracle9i, Oracle8i and Oracle8, Second Edition

Oracle Essentials: Oracle9i, Oracle8i and Oracle8, Second Edition

Rick Greenwald, Robert Stackowiak, Jonathan Stern

Publisher Resources

ISBN: 0596003366Errata Page