PL/SQL User's Guide and Reference Release 8.0 A54654_01 |
|
This appendix surveys the new features in release 8.0 of PL/SQL. Designed to meet your practical needs, these features will help you build effective, reliable applications.
External Procedures
Object Types
Collections
LOB Types
NLS Types
To support special-purpose processing and promote reuse of code, PL/SQL provides an interface for calling routines written in other languages. This makes the strengths and capabilities of those languages available to you.
An external procedure is a third-generation-language routine stored in a dynamic link library (DLL), registered with PL/SQL, and called by you to do special-purpose processing. At run time, PL/SQL loads the library dynamically, then calls the routine as if it were a PL/SQL subprogram. Typically, external procedures are used to interface with embedded systems, solve scientific and engineering problems, analyze data, or control real-time devices and processes.
For more information, see Chapter 10: External Procedures.
Object-oriented programming is based on the concept of interacting objects. In, PL/SQL, objects are instances of object types. When you define an object type using the CREATE TYPE statement (in SQL*Plus for example), you create an abstract template for some real-world object.
An object type encapsulates a data structure along with the functions and procedures needed to manipulate the data. At run time, when the data structure is filled with values, you have created an object. You can create as many objects as you need. Each object stores different real-world values.
Object types, which map directly into classes defined in object-oriented languages such as C++, reduce complexity by breaking down a large system into logical entities. This allows you to create software components that are modular, maintainable, and reusable.
For more information, see Chapter 9: Object Types.
The collection types TABLE and VARRAY allow you to declare nested tables and variable-size arrays (varrays for short). A collection is an ordered group of elements, all of the same type. Each element has a unique subscript that determines its position in the collection.
Collections work like the arrays found in most third-generation programming languages. They can store instances of an object type and, conversely, can be attributes of an object type. Also, collections can be passed as parameters. So, you can use them to move columns of data into and out of database tables or between client-side applications and stored subprograms.
For more information, see Chapter 4: Collections and Records.
The LOB (large object) datatypes BFILE, BLOB, CLOB, and NCLOB let you store blocks of unstructured data up to four gigabytes in size. And, they allow efficient, random, piece-wise access to the data.
LOB types store values, called locators, that specify the location of large objects stored out-of-line or in an external file. PL/SQL operates on LOBs through the locators. To manipulate LOBs, you use the supplied package DBMS_LOB, which is discussed in Oracle8 Server Application Developer's Guide.
For more information, see "Datatypes" on page 2-10.
Oracle8 offers extended NLS (National Language Support) including national character sets and the datatypes NCHAR and NVARCHAR2, which store NLS data. With NLS, number and date formats adapt automatically to the language conventions specified for a user session. So, users around the world can interact with Oracle in their native languages. NLS is discussed in Oracle8 Server Reference Manual.
Besides the database character set, which is used for identifiers and source code, PL/SQL now supports a second character set called the national character set, which is used for NLS data. The PL/SQL datatypes NCHAR and NVARCHAR2 allow you to store character strings formed from the national character set.
For more information, see "Datatypes" on page 2-10.