- Click to view our Accessibility Policy
- Skip to content
Country
Cloud AccountSign in to CloudSign Up for Free Cloud Tier
Oracle Account
- Sign-In
- Create an Account
- Help
- Sign Out
Contact Sales
PL/SQL Inherits Database Robustness, Security, and Portability
PL/SQL is a procedural language designed specifically to embrace SQL statements within its syntax. PL/SQL program units are compiled by the Oracle Database server and stored inside the database. And at run-time, both PL/SQL and SQL run within the same server process, bringing optimal efficiency. PL/SQL automatically inherits the robustness, security, and portability of the Oracle Database.
Try a PL/SQL Workout!
Why Use PL/SQL?
An application that uses Oracle Database is worthless unless only correct and complete data is persisted. The time-honored way to ensure this is to expose the database only via an interface that hides the implementation details—the tables and the SQL statements that operate on these. This approach is generally called the smart database or SmartDB paradigm, because PL/SQL subprograms inside the database issue the SQL statements from code that implements the surrounding business logic; and because the data can be changed and viewed only through a PL/SQL interface.
Build Your PL/SQL Knowledge
Get Started
Try PL/SQL in LiveSQL
Getting Started With PL/SQL
PL/SQL is a powerful, yet straightforward database programming language. It is easy to both write and read, and comes packed with lots of out-of-the-box optimizations and security features.
Building and Managing PL/SQL Program Units
- Building with Blocks: PL/SQL is a block-structured language; familiarity with blocks is critical to writing good code.
- Controlling the Flow of Execution: Conditional branching and iterative processing in PL/SQL
- Wrap Your Code in a Neat Package: Packages are the fundamental building blocks of any high quality PL/SQL-based application
- Picking Your Packages: Concepts and benefits of PL/SQL packages
- Error Management: An exploration of error management features in PL/SQL
- The Data Dictionary: Make Views Work for You: Use several key data dictionary views to analyze and manage your code
PL/SQL Datatypes
- Working with Strings in PL/SQL: PL/SQL offers several different string datatypes for use in your applications
- Working with Numbers in PL/SQL: Learn about and how to use the different numeric types in PL/SQL.
- Working with Dates in PL/SQL Dates are a relatively complex scalar datatype, in both SQL and PL/SQL
- Working with Records: A very common and useful composite type, PL/SQL’s analogue to a table’s row
- Error Management: PL/SQL’s implementation of arrays plays a role in almost every key performance feature of PL/SQL
- Working with Collections: Use several key data dictionary views to analyze and manage your code
SQL in PL/SQL
- Working with Cursors: PL/SQL cursors make it easy for you to manipulate the contents of database tables
- Bulk Processing with BULK COLLECT and FORALL: The most important performance feature in PL/SQL related to executing SQL
Practically Perfect PL/SQL with Steven Feuerstein
Practically Perfect PL/SQL (P3) offers videos on PL/SQL by Steven Feuerstein, Oracle Developer Advocate for PL/SQL and author of Oracle PL/SQL Programming.
Getting Rid of Hard-Coding in PL/SQL
This first playlist of P3 explores the various forms of hard-coding that can appear in PL/SQL, and how best to get rid of them.
Use Oracle PL/SQL with
- Oracle and PHP
- Oracle and Java
- Oracle and Python
- Oracle and .NET
- Oracle and Hadoop: Big Data Connectors
- Oracle and Node.js
Documentation
- Oracle Database 18c:
Database PL/SQL Language Reference,
PL/SQL Packages and Types Reference - Oracle Database 12c Release 2:
PL/SQL Language Reference,
PL/SQL Packages and Types Reference - Oracle Database 12c Release 1:
PL/SQL Language Reference,
PL/SQL Packages and Types Reference - Oracle Database 11g Release 2:
PL/SQL Language Reference,
PL/SQL Packages and Types Reference
Resources
- Presentation: Doing PL/SQL from SQL: Correctness and Performance (PDF)
- Presentation: New PL/SQL Capabilities in Oracle Database 12c (PDF)
- SmartDB Resource Center
- White paper: Doing SQL from PL/SQL: Best and Worst Practices (PDF)
- White paper: Freedom, Order, and PL/SQL Optimization
- White paper: How to write SQL injection-proof PL/SQL (PDF)
- White paper: With Oracle Database 12c, There is All the More Reason to Use Database PL/SQL (PDF)
- Why Use PL/SQL?
Related
- Analytical SQL
- Edition-based Redefinition
- Query Optimization
- SQL
Community
- Oracle LiveSQL: Try SQL and PL/SQL in your browser
- Oracle Dev Gym - Quizzes, Workouts and Classes
- PL/SQL Office Hours
- SmartDB Office Hours
- SQL-PL/SQL Oracle Developers Community Forum