C. Built-In Packages
Contents:
This appendix provides a quick summary of the most commonly used RDBMS-based packages built by Oracle Corporation and made available to all developers. Table C.1 shows the list of packages covered here. Unless otherwise noted, the packages are available in PL/SQL Release 2.1 and above.
All of the packages in Table C.1 are stored in the database and can be executed both by client- and server-based PL/SQL programs. In addition to these packages, many of the development tools, like Oracle Forms, offer their own specific package extensions, such as packages to manage OLE2 objects and DDE communication.[ 1 ]
C.1 Using the Built-in PackagesIn this appendix, I've provided a brief overview of each package, followed by a description and header for each program in the package. These headers are structured as follows: PROCEDURE pkg.procname (<parameter list>); FUNCTION pkg.funcname (<parameter list>) RETURN <return datatype>; where pkg is the name of the package, procname and funcname are the names of the programs, <parameter list> is the list of parameters (if there are no parameters, then you do not provide parentheses either) and <return datatype> is the datatype of the value returned by the function. Let's look at an example. Suppose that you want to receive a message from a pipe. The header for the built-in function which does this is: FUNCTION DBMS_PIPE.RECEIVE_MESSAGE=20 (pipename IN VARCHAR2, timeout INTEGER DEFAULT DBMS_PIPE.MAXWAIT) RETURN INTEGER; Note that all identifiers are in uppercase except for parameter names. This is consistent with my conventions: all keywords and other identifiers built by Oracle are in uppercase. The parameter names are lowercase because in many program headers, I have provided my own parameter names to make the headers more readable. When I want to call a packaged program, I must use dot notation. For example to make use of the RECEIVE_MESSAGE built-in, I would write code like this: DECLARE pipe_status INTEGER; BEGIN pipe_status DBMS_PIPE.RECEIVE_MESSAGE (mypipe, 10); END; Copyright (c) 2000 O'Reilly & Associates. All rights reserved. |
|