Why pl/sql is the primary language of oracle




















Also discusses user-defined subtypes and data conversion. You learn how to reference and manipulate whole collections of data and group data of different types together. Also shows how to process queries and transactions. Shows how to write and call procedures and functions. It discusses related topics such as parameters, overloading, and different privilege models for subprograms. Packages define APIs that can be reused by many applications.

Also includes usage notes and links to examples in the book. For the exact location of the directory, see the Oracle installation guide for your system.

These programs demonstrate many language features, particularly the most recent ones. For basic Oracle concepts, see Oracle Database Concepts.

Many of the examples in this book use the sample schemas, which are installed by default when you select the Basic Installation option with an Oracle Database installation.

Refer to Oracle Database Sample Schemas for information on how these schemas were created and how you can use them yourself. To download free release notes, installation documentation, white papers, or other collateral, please visit the Oracle Technology Network OTN.

You must register online before using OTN; registration is free and can be done at. This section describes the conventions used in the text and code examples of this documentation set. It describes:. We use various conventions in text to help you more quickly identify special terms. The following table describes those conventions and provides examples of their use. Ensure that the recovery catalog and target database do not reside on the same disk. Enter these elements as shown. This chapter explains its advantages and briefly describes its main features and its architecture.

For example:. Dynamic SQL lets you make your applications more flexible and versatile. Oracle Database can reuse these SQL statements each time the same code runs, which improves performance. Because stored subprograms run in the database server, a single invocation over the network can start a large job. This division of work reduces network traffic and improves response times. Stored subprograms are cached and shared among users, which lowers memory requirements and invocation overhead.

For more information about subprograms, see "Subprograms". The shared memory facilities of the shared server let Oracle Database support thousands of concurrent users on a single node.

For further scalability, you can use Oracle Connection Manager to multiplex network connections. Any number of applications can use the subprograms, and you can change the subprograms without affecting the applications that invoke them. Developers often use CGI scripts to produce web pages dynamically, but such scripts are often not optimal for accessing the database. For information about packages, see "Packages". The scripts run when Web clients, such as browsers, request the pages. A script can accept parameters, query or update the database, and then display a customized page showing the results.

During development, PSPs can act like templates, with a static part for page layout and a dynamic part for content. You can design the layouts using your favorite HTML authoring tools, leaving placeholders for the dynamic content.

When finished, you simply load the resulting PSP files into the database as stored subprograms. You can break complex problems into easily understandable subprograms, which you can reuse in multiple applications. You do not have to check every operation to ensure that it succeeded, as in a C program. These keywords divide the block into a declarative part, an executable part, and an exception-handling part. Only the executable part is required. A block can have a label.

For syntax details, see "Block". Declarations are local to the block and cease to exist when the block completes execution, helping to avoid cluttered namespaces for variables and subprograms.

Blocks can be nested: Because a block is an executable statement, it can appear in another block wherever an executable statement is allowed. If the subprogram has parameters, their values can differ for each invocation.

A function returns a result. For more information, see " External Subprograms ". A package is compiled and stored in the database, where many applications can share its contents. You can think of a package as an application. You can also use the many product-specific packages that Oracle Database supplies. You can specify the event, whether the trigger fires before or after the event, and whether the trigger runs for each event or for each row affected by the event.

Some subprograms in the packages in Table can both accept input and display output, but they cannot accept data directly from the keyboard. Data abstraction lets you work with the essential properties of data without being too involved with details. Composite Variables.

Abstract Data Types. You can use the cursor to retrieve the rows of the result set one at a time. You can use cursor attributes to get information about the state of the cursor—for example, how many rows the statement has affected so far.

For more information about cursors, see " Cursors Overview ". A composite variable has internal components, which you can access individually. You can pass entire composite variables to subprograms as parameters. In a collection , the internal components are always of the same data type, and are called elements. You access each element by its unique index. Lists and arrays are classic examples of collections. In a record , the internal components can be of different data types, and are called fields.

You access each field by its name. A record variable can hold a table row, or some columns from a table row. For every column of the full or partial row, the record has a field with the same name and data type. If the structure of the row changes, then the structure of the record changes accordingly.

If the declaration of the referenced item changes, then the declaration of the referencing item changes accordingly.

The variables that form the data structure are called attributes. The subprograms that manipulate the attributes are called methods. ADTs are stored in the database.



0コメント

  • 1000 / 1000