Unformatted text preview: a one-time-only procedure which is executed when the
package is first referenced and sets the public variable discount_rate = .10. The value of
100 is passed to the p_price parameter and this is multipled by the discount_rate resulting
in a value of 'Discounted 10' is displayed by the DBMS_OUTPUT.PUT_LINE.
B, C, D & E are incorrect
QUESTION 102: Which two statements about functions are true? (Choose two.)
A. A function must have a return statement in its body to execute successfully
B. Client-side functions can be used in SOL statements
C. A stored function that is called from a SOL statement can return a value of any
PL/SOL variable data type
D. From SOL*Plus, a function can be executed by giving the command EXECUTE
E. A stored function increases efficiency of queries by performing functions on the server
rather than in the application
Answer: A, E
There should be a RETURN statement in the function body. If the RETURN statement in
section is omitted, the function will successfully compile but the
following error will be generated at run time:
ORA-06503: PL/SQL: Function returned without value
This is because the function does not return any value to the calling block.
Actualtests.com - The Power of Knowing 1Z0-147
E. User-defined functions increase the efficiency of queries by applying the functions in
itself. This improves performance because the data will be filtered on the server as
opposed to the client which will reduce network traffic.
B. Functions must be stored on the server to be used in a SQL Statement.
C. Functions called from SQL expressions should return the data type that is compatible with
SQL. PL\SQL Data Types such as BOOLEAN, RECORD, or TABLE data types are not supported
D. Functions are not called like procedures. You cannot use EXECUTE to invoke a
function unless you have a variable to hold the returning value.
QUESTION 103: Examine this code
CREATE OR REPLACE PROCEDURE load bfile (p_flle_loc IN VARCHAR2)
CURSOR emp_cursor IS
View Full Document
This document was uploaded on 03/08/2014.
- Fall '09