Skip to Content
Oracle SQL: the Essential Reference
book

Oracle SQL: the Essential Reference

by David C. Kreines
September 2000
Intermediate to advanced
418 pages
11h 5m
English
O'Reilly Media, Inc.
Content preview from Oracle SQL: the Essential Reference

7.4. Execution Section

The execution section of a PL/SQL block is the only required section. It contains the PL/SQL code that actually performs some action; the exception section also performs an action, but only after being triggered by an action in the execution section. The general syntax of the execution section is:

BEGIN
   {assignment_statement    |
     proc_call    |
     control_statement    |
     PL/SQL_block    |
     SQL
				
				};
   [{assignment_statement    |
     proc_call    |
     control_statement    |
     PL/SQL_block    |
     SQL
    }; . . . ]
END;

7.4.1. Assignment Statements

An assignment statement provides a value to a PL/SQL variable. The general syntax of a PL/SQL assignment statement is:

					variable := expression;

Keywords

variable

Any previously declared PL/SQL variable.

:=

The PL/SQL symbol for assignment. Note the difference between := and the typical = used in many other languages.

expression

Any valid PL/SQL expression.

7.4.2. Expressions

PL/SQL expressions consist of one or more PL/SQL variables optionally combined with one or more PL/SQL operators. In PL/SQL, an expression may appear in one of the following locations:

  • On the right side of an assignment statement

  • As part of a control statement

  • As part of a SQL statement

The PL/SQL operators that may be used in expressions, along with their relative precedence (where 1 is the highest) are listed in Table 7-4.

Table 7-4. PL/SQL Operators
Operator Description Type Precedence
|| Concatenate two character strings Character 4
+ Addition Numeric 4
+ Unary identity ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Oracle Database 12c The Complete Reference

Oracle Database 12c The Complete Reference

Kevin Loney, Bob Bryla
Oracle SQL Developer

Oracle SQL Developer

Ajith Narayanan, Susan Harper
Oracle PL/SQL for DBAs

Oracle PL/SQL for DBAs

Arup Nanda, Steven Feuerstein

Publisher Resources

ISBN: 1565926978Catalog PageErrata