Why pl/sql




















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 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. You can design a data structure first, and then design algorithms that manipulate it. 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". 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. ADTs let you reduce complexity by separating a large system into logical components, which you can reuse. Conditional selection statements , which let you run different statements for different data values.

For more information, see "Conditional Selection Statements". Loop statements , which let you repeat the same statements with a series of different data values. Sequential control statements , which allow you to go to a specified, labeled statement, or to do nothing. For more information, see "Sequential Control Statements". For example, you can:. Use new features with the latest database release, and disable them when running the application in an older database release.

Activate debugging or tracing statements in the development environment, and hide them when running the application at a production site. You can use a basic loop, as in Example , or you can control the process precisely by using individual statements to run the query, retrieve the results, and finish processing.

The engine can be installed in the database or in an application development tool, such as Oracle Forms. This is useful if the application development tool can benefit from conditional and iterative control. For example, Oracle Forms applications frequently use SQL statements to test the values of field entries and do simple computations.

For information about this view, see Oracle Database Reference. Specifies whether the The default value is TRUE. Section 7. Cursors Cursor — introduce you to cursors including implicit and explicit cursors and shows you how to use them effectively to fetch data from a table.

Cursor with parameters — learn how to use the cursor with parameters to fetch data according to the input arguments passed to the cursor each time it is opened.

Updatable cursor — introduce you to the Oracle updatable cursor to update data in the table. Section 8. Implicit statement results — learn how to return one or more result sets from a procedure. Section 9. Package specification — show you step by step how to create a package specification. Package body — learn how to create a package body. Section Triggers Triggers — introduce you to the Oracle trigger and show you how to create a new trigger.

Statement-level triggers — learn how to use statement-level triggers to enforce additional security to the transaction. Row-level triggers — show you how to use row-level triggers for data-related activities. Disable triggers — show you to disable a trigger or all triggers of a table. Enable triggers — describe steps to enable a trigger or all triggers of a table.

Drop Triggers — guide you on how to drop a trigger from the database.



0コメント

  • 1000 / 1000