Oracle PL/SQL Block

Source: Internet
Author: User

Oracle PL/SQL Block

PL/SQL block Description: PL/SQL is the abbreviation of Procedure Language & Structured Query Language. It is an extension of standard database languages by Oracle.

PL/SQL block Syntax:

Declare
<Declaration part>
Begin
<Logical part>
Exception
When other then
<Exception Handling part>
End;

PL/SQL block syntax

Note: exception handling is similar to Exception Handling in other languages from low to high.

Common Oracle Exception Handling
Name Description
Other Including all exceptions (maximum exceptions)
Value_error Value exception
No_data_found No data found
Too_many_rows Too much data

Declare PL/SQL packages

Syntax:

-- Package declaration similar interface
Create or replace package name
As
<The declaration part can be the stored procedure of variable functions>
End

-- Package implementation Interface
Create or replace package body package name
As
<Implement declaration of some function stored procedures>
End

PL/SQL package

Declare PL/SQL Functions

Syntax:

Create or replace function method name return value
As
<Declaration variable>
Begin
<Logical body>
End;

-------------------------------------- Split line --------------------------------------

Rlwrap

SQLPLUS spool to dynamic Log File Name

Oracle SQLPLUS prompt settings

Accelerate SQL return by setting SQLPLUS ARRAYSIZE (row prefetch)

PL/SQL Developer Practical Skills

-------------------------------------- Split line --------------------------------------

Related Article

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.