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

Overview of PL/SQL

Advantages of PL/SQL

PL/SQL is a completely portable, high-performance transaction processing language that offers the following advantages:

Full Support for SQL

PL/SQL lets you use all the SQL data manipulation, cursor control, and transaction control commands, as well as all the SQL functions, operators, and pseudocolumns. So, you can manipulate Oracle Database data flexibly and safely. PL/SQL fully supports SQL datatypes, reducing conversions as data is passed between applications and the database.

Dynamic SQL is a programming technique that lets you build and process SQL statements "on the fly" at run time. It gives PL/SQL flexibility comparable to scripting languages such as Perl, Korn shell, and Tcl.

Tight Integration with Oracle Database

PL/SQL supports all the SQL datatypes. Combined with the direct access that SQL provides, these shared datatypes integrate PL/SQL with the Oracle Database data dictionary.

The %TYPE and %ROWTYPE attributes let your code adapt as table definitions change. For example, the %TYPE attribute declares a variable based on the type of a database column. If the column's type changes, your variable uses the correct type at run time. This provides data independence and reduces maintenance costs.

Better Performance

If your application is database intensive, you can use PL/SQL blocks to group SQL statements before sending them to Oracle Database for execution. This can drastically reduce the communication overhead between your application and Oracle Database.

PL/SQL stored procedures are compiled once and stored in executable form, so procedure calls are quick and efficient. A single call can start a compute-intensive stored procedure, reducing network traffic and improving round-trip response times. Executable code is automatically cached and shared among users, lowering memory requirements and invocation overhead.

Programmatic Environments 1-5

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