When the SELECT statements are combined into a PL/SQL program, they are sent to the server as a single unit thus reducing network traffic.
2)
B
Executable section is the only mandatory section for a PL/SQL block. As a result,
BEGIN NULL; -- null statement END;
is a valid PL/SQL block.
3)
B
When a runtime error occurs in the PL/SQL block, control is passed to the exception-handling section of the block, where the error is evaluated and a specific exception is raised or executed.
4)
A
A PL/SQL compiler is able to detect only syntax errors. It cannot detect any runtime errors because they do not occur prior to the execution of the program.
5)
B
For named PL/SQL blocks, p-code is generated and stored in the database at the time of compilation. When named PL/SQL block is executed, its p-code is retrieved from the database and executed. For anonymous PL/SQL blocks, p-code is not stored in the database and is generated every time the PL/SQL block is executed.
Lab 2.2 Self-Review Answers
A5:
Questions
Answers
Comments
1)
B
A semicolon is a terminating symbol of an individual statement in the PL/SQL block.
2)
A
Substitution variables are used for input values only. They cannot be used to output values because no memory is allocated for them.
3)
A
The statement DBMS_OUTPUT.PUT_LINE uses dot notation as follows :
package_name.procedure_name
where package_name is the name of the package and procedure_name is the name of the procedure defined in the package.
4)
A
When a program completes, the information from the buffer is displayed on the screen.
5)
C
When the SET SERVEROUPUT ON command is used without specifying the size if the buffer, it enables the DBMS_OUTPUT.PUT_LINE statement and the default buffer size is used. The SIZE option changes the default buffer size to the specified size.