PL/SQL is a block structure language.
The block consists of the definition part, execution part, and Exception Handling part.
Syntax structure:
Declare
/*
* Definition: used to define variables
*/
Variable name variable type
V1 varchar2 (10 );
Begin
/*
* Execution part, used for value assignment
*/
V1: = '000000 ';
Exception
Exception Section
When others then dbms _ output. put_linel ('error ')
End
Feature: The Variable Area defines variables and cannot be used in other variables.
Code area: normal Code Execution
Exception zone: Exception Handling Area
The functions of different regions cannot be changed.
TIPS: it is best to define numbers without wasting space. With Parameters
To define varchar, you must specify the length (set the length in the script (char length is 1 by default) and variable length (varchar must define the length <1-32767> ,)
When creating a table, the variable length field can only be near 4000