PLEX Documentation (58k)
PLEX Source (267k)
Read Entire PLEX Document online
NT PLEX See the readme in the download!! (62)

Preface

We developed PLEX in response to an ever-increasing demand for access to foreign data sources from within PL/SQL stored procedures. Our goal was to outline a means of calling C routines from within PL/SQL without the need for any special software from Oracle. After we discovered a means of accomplishing this task, we tried to simplify it by automating the process as much as possible. PLEX is the result of this effort.

Since we don't make use of anything except PL/SQL and Pro*C, PLEX is something that could have been built by any experienced Oracle user. Consequently, we decided to distribute all of the source code behind PLEX. This means that you can accept it "as is" for use in your own applications. If you would like to improve upon it, feel free. We probably will continue to add enhancements as well. However, we can't promise to improve upon it. We can't even promise to fix any problems that you might find. Despite this, we'd like to hear from you if you do run into difficulties.

We would, of course, also like to hear from those of you who successfully utilize PLEX in your applications. Just drop us an email and tell us your stories. We'll keep track of everyone who sends us a note and use the list to notify you in the event that we release an updated version of the product.

PLEX is not an end user tool, it is a developers tool. It is expected that you have some experience with PL/SQL and with the C programming language. While you could modify PLEX to support languages other than C, this would still require a knowledge of C. Familiarity with the UNIX operating system will also be helpful.

History

PLEX (PL/SQL Extender) is a tool that allows application developers to add functionality to the PL/SQL language used in the Oracle7 server. PLEX provides all the facilities necessary to embed 3GL code such as C, Ada, or COBOL into a module, and then invoke the services of that module from within any Oracle environment. For example, a 3GL module that is capable of executing a command in the operating system (e.g., issuing 'ls' the UNIX command to list files) can now be invoked from within SQL*Plus, Oracle*Forms, a client 3GL program developed with Pro*C, or any number of Oracle7 applications simply by issuing a stored procedure call. Similarly, a database trigger may make use of this facility to propagate changes made in the Oracle RDBMS to other systems outside of Oracle transparently.

The potential to extend PL/SQL has always existed in the Oracle7 product line via a mechanism called database pipes. The database pipes package (one of the many packages supplied with the Oracle7 database) allows applications to talk to other applications via a 'pipe' mechanism similar to pipes in UNIX, or Sockets in TCP/IP. A white paper, written over a year before the actual development of PLEX, describes in detail how to use pipes to extend the PL/SQL language. PLEX, very simply, automates the development of these extensions by generating all the database pipe communication calls. This white paper, Application Servers: Exploiting Database Pipes, is included in this introduction to provide some of the background and history that lead to the development of PLEX.

System Requirements

PLEX requires the following software: The PLEX installation creates a user called "PLEX" that holds a few tables and stored procedures. In order for these stored procedures to work, the PLEX user must have the execute privilege on the dbms_pipe and dbms_alert packages that are distributed with Oracle7. Because these packages are created by SYS, the installation script can't create them or grant execute on them unless it connects as SYS (which it doesn't).

Typical Development Loop

The things you as a developer will need to know how to do are; Creating a new PLEX server, Adding functions to an existing one; And occasionally removing functions from an existing one. These steps and the commands used to perform them are explained in this section.

In general the steps to create a new server, add a second function to it, and remove a function from it would look like this:

  1. Create and compile a PL/SQL stub
  2. Grant execute on this stub to the user account PLEX
  3. Execute the makesrc command to generate the C module
  4. Enter your code in the generated C module
  5. Execute PLEXmk to compile and link the server
  6. Execute your server
  7. Stop the server
  8. Add another function by performing steps 1-7 again
  9. Remove a function from the database
  10. Execute a delete statement against the table PLEX.PLEX_SERVER_TO_FUNCTION to remove the entry for the delete function/procedure
  11. Execute the command makeep userid/password server-name to re-build point table for your server
  12. Perform steps 5-7 to test your new server.

PLEX Documentation (58k)

PLEX Source (267k)

Read Entire PLEX Document online


Found an obsolete link ? A typo ? Why don't you tell me about it!


All information and materials provided here are provided "as-is"; Oracle disclaims all express and implied warranties, including, the implied warranties of merchantability or fitness for a particular use. Oracle shall not be liable for any damages, including, direct, indirect, incidental, special or consequential damages for loss of profits, revenue, data or data use, incurred by you or any third party in connection with the use of this information or these materials.