Intermediate

Q:

27-20.

The following table summarizes the similarities and differences between native PL/SQL procedures and external procedures.

Native PL/SQL Procedures

External Procedures

Support for all Oracle built-in and user-defined datatypes

Support for only a subset of Oracle built-in datatypes

Source code stored in database

Compiles source code into a shared library on the native operating system

Functions can be used in SQL statements

Functions in an external library cannot be used in an SQL statement

Listener isn’t required

Requires a listener process to interact with the database

Q:

27-21.

With the advent of external procedures comes the ability to call programs that can do things not currently supported by the PL/SQL language. Even with the large strides made in the Oracle8i release, there are operations that still require operating system-level programming (e.g., deleting an OS file). Programmers are no longer limited to performing tasks in PL/SQL that are directly supported. They can now write code in any Oracle-supported language and then call this code using the external procedure method.

Q:

27-22.

To use an external procedure, you must follow these steps:

  1. The DBA must have configured the listener to run the external program on the caller’s behalf. Details of how this listener should be created, and other configuration file changes, are available in Oracle documentation (it involves changes to both the TNSNAMES.ORA and LISTENER.ORA files).

  2. Create a shared library (.so or .DLL file) ...

Get Oracle PL/SQL Programming: A Developer's Workbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.