4. Oracle PL/SQL language and programming

Source: Internet
Author: User

PL/SQL Basic structure
PL/SQL data type Numeric type: Number (p,s), Pls_integer, Binary_integer
Character types: CHAR, NCHAR, VARCHAR2, NVARCHAR2, LONG
Day Type: Date
Boolean Type: Boolean
Define data type: type
Type < data type name > is < data type >;
Data type: Oracle allows you to define Recode, TABLE

PL/SQL Constants and variables< constant name > constant < constant type >: = < value >;
< variable name >< data type >[(width):=< initial value >];
variable is initialized to null

PL/SQL Statement control Structure NULL: The judgment statement executes when the expression is true, Null/false does not execute
IF:
Case:
Loop structure:
LOOP ... EXIT ... END
LOOP ... EXIT when ... END
While ... LOOP ... END
For ... In ... LOOP ... END
Goto:

PL/SQL Expressions:
PL/SQL cursors: Displaying cursors: Declaring cursors, opening cursors, extracting cursors, closing cursors
Example:
Implicit cursors: no definition, only one row of records
Cursor Properties:
An implicit cursor with a cursor named SQL
%isopen: Whether the cursor is open
%found: Whether the current cursor points to a valid row (%notfound)
%rowcount: Number of cursor rows
Parameterized cursors: parameters are defined with the cursor, when the cursor is used, the parameters are different, the selected rows of data are different. Cursor variables are not read

Process creation:
Call Procedure:
EXECUTE Procedure name (input parameter)
Delete procedure:
DROP PROCEDURE Procedure Name
Way:
In: Input parameters
Out: Parameters that are assigned during the process
In out: parameters that are entered and assigned in the process

Function:
Package: Baotou + package Body

Triggers: Example:
Trigger event: Before, after




4. Oracle PL/SQL language and programming

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.