In general, PL / SQL consists of three parts, namely the declaration, part of writing the commands to be executed and the exception. In this post, i will share about Structure of PL / SQL.
Here is the Structure of PL / SQL:
· The Declaration,
This section is optional or not an absolute to be written. Because not all PL / SQL variable or constant need to be declared.
· Writing Commands section,
This section is a vital part of a PL / SQL, as if in a PL / SQL are not artifacts of this part of the PL / SQL does not mean anything.
· The Exception,
This section also is optional and should not exist in a PL / SQL. The usefulness of this section to indicate when an error occurs in the PL / SQL that you create. If you are sure the PL / SQL that you created is correct, then you do not need to write this section.
Here is an example of the general syntax of writing PL / SQL:
DECLARE
tipe_data variables; - declare variables
tipe_data constant constant: = value; - declare a constant
...
BEGIN
statement_1;
statement_2;
...
Exception
THEN WHEN nama_eksepsi
statement_untuk_mengatasi_error;
...
END;
Here is the Structure of PL / SQL:
· The Declaration,
This section is optional or not an absolute to be written. Because not all PL / SQL variable or constant need to be declared.
· Writing Commands section,
This section is a vital part of a PL / SQL, as if in a PL / SQL are not artifacts of this part of the PL / SQL does not mean anything.
· The Exception,
This section also is optional and should not exist in a PL / SQL. The usefulness of this section to indicate when an error occurs in the PL / SQL that you create. If you are sure the PL / SQL that you created is correct, then you do not need to write this section.
Here is an example of the general syntax of writing PL / SQL:
DECLARE
tipe_data variables; - declare variables
tipe_data constant constant: = value; - declare a constant
...
BEGIN
statement_1;
statement_2;
...
Exception
THEN WHEN nama_eksepsi
statement_untuk_mengatasi_error;
...
END;
That was a brief description of the structure of pl sql. If there are errors or omissions please justified or added. may be useful
0 komentar
Posting Komentar