O'Reilly logo

Oracle SQL: A Beginner’s Tutorial by Djoni Darmawikarta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 10

PL/SQL

PL/SQL, short for Procedural Language extension to SQL, complements SQL with a procedural programming language. PL/SQL is a feature of the Oracle database.

The objective of this chapter is to introduce some of the most commonly used PL/SQL features such as

 

▪  row-by-row processing of query output

▪  if-then-else decision logic

▪  exception handling

▪  user-defined functions

Row-by-row Processing

You learned in the previous chapters that the output of a query can be more than one row. You can write a PL/SQL program to process query output row-by-row sequentially.

The structure of the PL/SQL program for row-by-row processing is as follows.

 

BEGIN

  FOR output_row_variable IN (

    SELECT ...)

  LOOP

    row processing statements; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required