PL/SQL Chapter 6: Functions
questions with correct answers
A function is quite similar to a procedure in that it is a program unit that achieves a task, can
receive input values, and returns values to the calling environment. - ANS ✔✔TRUE
The main difference between functions and procedures is that a function is part of an
expression. - ANS ✔✔TRUE
Procedures can be used in SQL statements. - ANS ✔✔FALSE
The RETURN statement can return constant values, such as a text string. - ANS ✔✔TRUE
You can include multiple RETURN statements in the body of a function. - ANS ✔✔TRUE
The RETURN statement in a function is used to control the flow of execution. - ANS ✔✔FALSE
The term "actual parameters" refers to the parameters that are listed in the program unit. - ANS
✔✔FALSE
The term "formal parameters" refers to the arguments that are used when calling or invoking
the program unit. - ANS ✔✔FALSE
Formal parameters including the RETURN data type cannot include size information. - ANS
✔✔TRUE
,The term "passed by value" means that a pointer to the value in the actual parameter is created
instead of copying the value from the actual parameter to the formal parameter. - ANS
✔✔FALSE
The term "passed by reference" means that the value is copied from the actual parameter to
the formal parameter. - ANS ✔✔FALSE
It is possible to reference a data dictionary to determine what code is contained in a program
unit. - ANS ✔✔TRUE
The following is a correct example of the use of the DROP command.
DROP function_name; - ANS ✔✔FALSE
A(n) procedure is one type of program unit that is used to accomplish one or more tasks, return
none or many values, and is used only in PL/SQL statements. - ANS ✔✔TRUE
A(n) procedure is part of an expression and cannot serve an entire statement. - ANS ✔✔FALSE
function
A(n) procedure cannot be invoked in a standalone fashion. - ANS ✔✔FALSE
function
In a(n) function, the RETURN statement includes no arguments and is followed with a
semicolon. - ANS ✔✔FALSE
, procedure
You cannot include data type information when declaring a formal parameter. - ANS ✔✔FALSE
size
The term passed by value implies that a pointer to the value in the actual parameter is created
instead of copying the value from the actual parameter to the formal parameter. - ANS
✔✔FALSE
passed by reference
The term passed by reference implies that the value is copied from the actual parameter to the
formal parameter. - ANS ✔✔FALSE
passed by value
The default behaviors of value passing can be overridden by using a compiler hint named
NOCOPY. - ANS ✔✔TRUE
Functions cannot be used in a(n) CHECK constraint or as a default value of a table column. - ANS
✔✔TRUE
Deleting a program unit can be accomplished by issuing a(n) DEL command. - ANS ✔✔FALSE
DROP
Which of the following statements is incorrect?
questions with correct answers
A function is quite similar to a procedure in that it is a program unit that achieves a task, can
receive input values, and returns values to the calling environment. - ANS ✔✔TRUE
The main difference between functions and procedures is that a function is part of an
expression. - ANS ✔✔TRUE
Procedures can be used in SQL statements. - ANS ✔✔FALSE
The RETURN statement can return constant values, such as a text string. - ANS ✔✔TRUE
You can include multiple RETURN statements in the body of a function. - ANS ✔✔TRUE
The RETURN statement in a function is used to control the flow of execution. - ANS ✔✔FALSE
The term "actual parameters" refers to the parameters that are listed in the program unit. - ANS
✔✔FALSE
The term "formal parameters" refers to the arguments that are used when calling or invoking
the program unit. - ANS ✔✔FALSE
Formal parameters including the RETURN data type cannot include size information. - ANS
✔✔TRUE
,The term "passed by value" means that a pointer to the value in the actual parameter is created
instead of copying the value from the actual parameter to the formal parameter. - ANS
✔✔FALSE
The term "passed by reference" means that the value is copied from the actual parameter to
the formal parameter. - ANS ✔✔FALSE
It is possible to reference a data dictionary to determine what code is contained in a program
unit. - ANS ✔✔TRUE
The following is a correct example of the use of the DROP command.
DROP function_name; - ANS ✔✔FALSE
A(n) procedure is one type of program unit that is used to accomplish one or more tasks, return
none or many values, and is used only in PL/SQL statements. - ANS ✔✔TRUE
A(n) procedure is part of an expression and cannot serve an entire statement. - ANS ✔✔FALSE
function
A(n) procedure cannot be invoked in a standalone fashion. - ANS ✔✔FALSE
function
In a(n) function, the RETURN statement includes no arguments and is followed with a
semicolon. - ANS ✔✔FALSE
, procedure
You cannot include data type information when declaring a formal parameter. - ANS ✔✔FALSE
size
The term passed by value implies that a pointer to the value in the actual parameter is created
instead of copying the value from the actual parameter to the formal parameter. - ANS
✔✔FALSE
passed by reference
The term passed by reference implies that the value is copied from the actual parameter to the
formal parameter. - ANS ✔✔FALSE
passed by value
The default behaviors of value passing can be overridden by using a compiler hint named
NOCOPY. - ANS ✔✔TRUE
Functions cannot be used in a(n) CHECK constraint or as a default value of a table column. - ANS
✔✔TRUE
Deleting a program unit can be accomplished by issuing a(n) DEL command. - ANS ✔✔FALSE
DROP
Which of the following statements is incorrect?