(v) PL/SQL operators and Precedence | Conditional Control | Loop control

Source: Internet
Author: User
Tags arithmetic arithmetic operators case statement logical operators

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.