2 Day Developer > Using PL/SQL > Overview of PL/SQL
Overview of PL/SQL |
Previous |
Next |
PL/SQL is an Oracle's procedural language extension to SQL. It is a server-side, stored procedural language that is easy-to-use, seamless with SQL, portable, and secure.
PL/SQL enables you to mix SQL statements with procedural constructs. With PL/SQL, you can create and run PL/SQL program units such as procedures, functions, and packages. PL/SQL program units generally are categorized as anonymous blocks, stored functions, stored procedures, and packages.
The following can be constructed with the PL/SQL language:
Anonymous block
An anonymous block is a PL/SQL block that appears in your application and is not named or stored in the database. In many applications, PL/SQL blocks can appear wherever SQL statements can appear. A PL/SQL block groups related declarations and statements. Because these blocks are not stored in the database, they are generally for one-time use.
Stored or standalone procedure and function
A stored procedure or function is a PL/SQL block that Oracle Database XE stores in the database and can be called by name from an application. Functions are different than procedures in that functions return a value when executed. When you create a stored procedure or function, Oracle Database XE parses the procedure or function, and stores its parsed representation in the database. See Using Procedures, Functions, and Packages.
Package
A package is a group of procedures, functions, and variable definitions that Oracle Database XE stores in the database. Procedures, functions, and variables in packages can be called from other packages, procedures, or functions. See Using Procedures, Functions, and Packages.
Trigger
A database trigger is a stored procedure associated with a database table, view, or event. The trigger can be called after the event, to record it, or take some follow-up action. The trigger can be called before the event, to prevent erroneous operations or fix new data so that it conforms to business rules. See Using Triggers.