PL/SQL language development Reference Manual II: PL/SQL program structure

Source: Internet
Author: User

PL/SQL language development Reference Manual II: PL/SQL program structure

PL/SQL language development Reference Manual
1,PL/SQL Block
1) Declaration, declare (if the statement does not need to declare any variables, you can leave it empty );
2) execution part, begin <---------> end;
3) exception handling, exception (may not );
2,PL/SQL Development Environment
You can use any plain text editor to edit a file, for example, Vi.
3,PL/SQL Character Set
Letter: A-Z, A-Z;
Number: 0-9;
Blank: tab, space, and press Enter;
Symbol: + _) (* & ^ % $ #@!~ ;
PL/SQL is case insensitive (note)
4,Identifier naming rulesA:
1) start with a letter:
2) followed by any non-space characters, numbers, currency symbols ($), underscores (_), or #;
3) the maximum length is 30 characters (about 8 characters );
Used to name objects (potential rules ):
Variable: starting with V _
Cursor: starting with C _
Type:
Subroutine:
5,Delimiter
1) operator +-*/** (exponential operator)
2) link = (equivalent to = in Java)> <>! = ~ ==<=>=
3) Value assignment: = Example A: = 2
4) join | example: 'abc' | 123
5) Labels <required tags>
6) comment -- (single line)/**/(paragraph)
7) replace <scape> <tab> <enter>
6,Text
1) character text (string)
'Tom '(single quotes)
'Tom's pen ''is a pair of single quotes (marked escape) and a Tom's pen.
2) digital
123-4 + 56 0 9.0 1.23e5 9.8e-3
3) Boolean
True False null
7,Variable Declaration
Syntax var_name [constant] (ID constant, Optional) Type [not null] (ID is not-null and must be initialized later) [: = value] (assign value, initialization );
Var_name [constant] (ID constant, Optional) Type [not null] [default value] (Value assignment, initialization) is equivalent to the preceding statement;
Note:
1) The statement can have a default value or not;
2) If [constant] [not null] exists, the variable must have an initial value;
3) The value assignment statement is ": = ";
4) variables can be considered as a field in the database;
5) it is specified that the variable not initialized is null;

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.