Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
4.96 Mб

Overview of PL/SQL

Collections A collection is an ordered group of elements, all of the same type (for example, the grades for a class of students). Each element has a unique subscript that determines its position in the collection. PL/SQL offers two kinds of collections: nested tables and varrays (short for variable-size arrays).

Collections work like the set, queue, stack, and hash table data structures found in most third-generation programming languages. Collections can store instances of an object type and can also be attributes of an object type. 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. You can define collection types in a PL/SQL package, then use the same types across many applications.


Applications written in PL/SQL can run on any operating system and hardware platform where Oracle Database runs. You can write portable program libraries and reuse them in different environments.


PL/SQL stored procedures let you divide application logic between the client and the server, to prevent client applications from manipulating sensitive Oracle Database data. Database triggers written in PL/SQL can prevent applications from making certain updates, and can audit user queries.

You can restrict access to Oracle Database data by allowing users to manipulate it only through stored procedures that have a restricted set of privileges. For example, you can grant users access to a procedure that updates a table, but not grant them access to the table itself.

See Also: Oracle Database Security Guide for details on database security features

Built-In Packages for Application Development

DBMS_PIPE is used to communicate between sessions.

DBMS_ALERT is used to broadcast alerts to users.

DBMS_LOCK and DBMS_TRANSACTION are used for lock and transaction management.

DBMS_AQ is used for Advanced Queuing.

DBMS_LOB is used to manipulate large objects.

Programmatic Environments 1-7

Соседние файлы в папке Oracle 10g