Oracle --- basic PL/SQL knowledge

Source: Internet
Author: User
PLSQL is a programming language developed by Oracle and dedicated to Oracle. Data operation and query statements are included in PLSQL code program units (PLSQL blocks ).

PL/SQL is a programming language developed by Oracle and dedicated to Oracle, data Operations and query statements are included in PL/SQL code program units (PL/SQL blocks ).

Definition of PL/SQL Blocks

Like other languages, the names of variables, constants, cursors, and Exception Handling used in PL/SQL must be defined first and then used. And the part starting with the DECLARE keyword must be defined.

Executable part of PL/SQL Block

This part is the main body of the PL/SQL block and contains the executable statements of the block. This part defines the block function and is required. Starts with the keyword BEGIN and ends with END.

PL/SQL block Exception Handling Section

This part contains the exception handler (error handler) of the block ). When a statement in the block program body encounters an exception (an error is detected), oracle transfers the program control to the corresponding exception handler in the exception Section for further processing. This part starts with the keyword EXCEPTION and ends with the END keyword.

DECLARE-optional

-Special types of variables, constants, cursors, and user-defined

BEGIN-required

-SQL statement

-PL/SQL statements

EXCEPTION-optional

-Handling actions when an error occurs

END;-required

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.