COMPILER DESIGN

ADVANCED TOPICS IN COMPILER DESIGN

CODE GENERATION FOR OBJECT ORIENTED LANGUAGES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
What are the characteristics of an anonymous block? (Choose two.)
A
Stored in the database
B
Can be declared as procedures or as functions
C
Compiled each time the code is executed
D
Unnamed
Explanation: 

Detailed explanation-1: -An anonymous block is a block of code that is compiled each time it is issued. It is not stored in the database and it cannot be invoked from another PL/SQL block of code. A named block is the block of code that is compiled and stored in the database and can be called by another block of code.

Detailed explanation-2: -The PL/SQL program structure divides the code into blocks distinguished by the following keywords: DECLARE, BEGIN, EXCEPTION, and END . An unnamed PL/SQL code block (code not stored in the database as a procedure, function, or package) is known as an anonymous block.

Detailed explanation-3: -A named block is stored into the Oracle Database server and can be reused later. A block without a name is an anonymous block. An anonymous block is not saved in the Oracle Database server, so it is just for one-time use. However, PL/SQL anonymous blocks can be useful for testing purposes.

Detailed explanation-4: -Introduction to Anonymous Blocks A PL/SQL block is defined by the keywords DECLARE, BEGIN, EXCEPTION, and END. These keywords divide the block into a declarative part, an executable part, and an exception-handling part. Only the executable part is required.

There is 1 question to complete.