SQL-ProgrammingLanguage-Page20

                                                                                                    

👉What is PL/SQL block?

1)PL/SQL provides functionalities of conditional checking, branching, and looping. SQL does not provide these facilities.

2)PL/SQL sends an entire block of SQL statements to the Oracle engine all in one go, thus reducing network traffic. While SQL statements are passed to the Oracle engine one at a time.

3)PL/SQL also permits dealing with errors as required and facilitates displaying user-friendly messages, when error(s) are encountered. In the case of SQL, Oracle displays its own error messages.

A single PL/SQL code block consists of a set of SQL statements, clubbed together and passed to the Oracle engine entirely.

The sections of a PL/SQL block are:

✅Declarative Part:

Code block starts with a declaration section, in which memory variables and other Oracle objects can be declared and initialized. Once declared, they can be used in SQL statements for data manipulation.

✅Executable Part:

It consists of a set of SQL and PL/SQL statements, which describe processes that have to be applied to table data. Ex: Manipulation, retrieval, looping

✅Exception Handling Part:

This section deals with the handling errors that arise during the execution of code in the executable part.

✅Comments:

"--" To comment a single line
"/* ..... 
      ..... */  To comment all lines within this block


Comments

Popular posts from this blog

SQL-ForeignKeyConstraint-Page6

Javascript-OOPs(Part3)-Inheritance - (9)

Javascript-Unobtrusive - (6)