1. The data types in PL/SQL are as follows:
Number [(m, n)] is a unique numerical value. M-precision, N-decimal places. Integer and real are synonymous with number.
Varchar2 (maxsize [char | byte]) is a unique string type. Char and vachar are synonymous with varchar2. Nvarchar2 and varchar2 share the same performance, but are only used for international character set data types.
Date/time type.
Boolean. Only true and false values are supported.
Ii. PL/SQL Execution body
Declare
-- Variable Declaration
Begin
-- Run the statement
Exception
-- Exception Handling
End;
Iii. PL/SQL Control Structure
1. IF-THEN-ELSIF Structure
If condition then
Elsif condition then
End if;
2. Case Structure
Case
When condition then
When condition then
...
Run when all else conditions are not met
End;
Iv. loop structure (see the example)
Declare
I integer;
Begin
Dbms_output.put_line ('loop output ');
I: = 0;
Loop
Exit when I> = 10;
Dbms_output.put_line (I );
I: = I + 1;
End loop;
Dbms_output.put_line ('while output ');
I: = 0;
While I <10 Loop
Dbms_output.put_line (I );
I: = I + 1;
End loop;
Dbms_output.put_line ('for output ');
For I in 1 .. 10 Loop
Dbms_output.put_line (I );
End loop;
Exception
When others then
Dbms_output.put_line ('exception ');
Raise;
End;
/