One, operator
The PL/SQL language has rich built-in operators that provide the following types of operators:
. Arithmetic operators
. Relational operators
. Comparison operators
. Logical operators
. String operators
Second, operator precedence
Arithmetic Operators |
operator |
operator |
** |
Exponential arithmetic |
+, - |
Add, take the inverse |
*, / |
Multiplication, Division |
+, -, || |
Add, subtract, and place |
Relational operators Comparison operators |
=, <,;, <=, >=, <>,! =, ~=, ^=, Is NULL, like, between, in |
Comparison |
logical Operators |
Not |
Logical negation |
and |
Association |
OR |
Contains |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
First, condition control
Statement |
Description |
If-then statements |
The IF statement is associated with a sequence of statements that are enclosed by the then and end if keywords. If the condition is true, the statement is executed and if the condition is false or NULL, the IF statement does nothing |
If-then-else statements |
The IF statement adds an alternative sequence of statements that follow the keyword else. If the condition is false or NULL, the statement is executed only by the replacement sequence. It ensures that the sequence of any statement is executed |
If-then-elsif statements |
It can be selected between several scenarios |
Case statement |
Like the If statement, the case statement selects a sequence of statements to execute. But in order of choice, the case statement uses one selection instead of multiple Boolean expressions. An expression with a selector whose value is used to select one of several options |
Searched CASE statement |
The case statement that is searched has no choice, and its when clause contains the search condition that produced the Boolean value. |
Inline If-then-else |
You can use another if-then or if-then-elsif declaration in a if-then or If-then-elsif statement |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
First, Cycle control
Loop Type |
Description |
PL/SQL Foundation loops |
In this loop structure, the statement sequence is enclosed between the loop and end loop statements. In each iteration, the statement sequence is executed, and then the control is resumed at the top of the loop |
PL/SQL While loop |
Repeating a statement or a group, and given a condition that is true, before it tests the condition to execute the loop body |
PL/SQL for loop |
Execute statement sequence multiple and shorthand code to manage the loop variable |
PL/SQL Inline loops |
can use any of the other basic loops in one or more loops, while or looping |
(v) PL/SQL operators and Precedence | Conditional Control | Loop control