1Z0-149 practice question 6 of 15
Which three are true about functions and procedures? (Choose three.)
Full set: 65 questionsA core principle of a PL/SQL function is that it must return a value. Therefore, the compiler enforces that every possible execution path concludes with a RETURN statement that specifies a value (an expression). This makes options B and F correct. In contrast, a procedure does not return a value. Its RETURN statement is optional and serves only to exit the subprogram immediately; it cannot include an expression, making option E correct.
A. The ACCESSIBLE BY clause is a security feature that can be applied to various program units, including both procedures and functions.
C. Actual parameters for IN mode can be variables, literals, constants, or complex expressions, not just constants.
D. Only functions that adhere to purity rules (e.g., not modifying database tables) can be invoked from SQL DML statements. Procedures cannot be called this way.
- Oracle Database, PL/SQL Language Reference, 19c, Chapter 9, "PL/SQL Subprograms". The sections "Function Declaration and Definition" and "Procedure Declaration and Definition" describe their fundamental differences.
- Oracle Database, PL/SQL Language Reference, 19c, "RETURN Statement". This section details the different syntax and usage of RETURN in functions (RETURN expression;) versus procedures (RETURN;).
- Oracle Database, PL/SQL Language Reference, 19c, "ACCESSIBLE BY Clause". The documentation shows this clause is applicable to standalone subprograms (functions and procedures), packages, and types.
Keep practicing
Take the free 1Z0-149 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other 1Z0-149 practice questions
- Question 3Which two PL/SQL elements can be deprecated using the DEPRECATE pragma? (Choose two.)
- Question 5Which two statements are true about using the OR REPLACE clause when creating named subpr…
- Question 8Which two are true about the PLSQL_CODE_TYPE parameter? (Choose two.)
- Question 9Which three SQL statements, embedded in PL/SQL, typically benefit from using variables de…
- Question 11SERVEROUTPUT is enabled. Which code block will display the values from 1 to 10 in descend…
- Question 15SERVEROUTPUT is enabled. Which is the correct method to use a PACKAGED CONSTANT in SELECT…
