Given a function CALCTAX:
CREATE OR REPLACE FUNCTION calctax (sal NUMBER) RETURN NUMBER
IS
BEGIN
RETURN (sal * 0.05);
END;
If you want to run the above function from the SQL *Plus prompt, which statement is true?
A.
You need to execute the command CALCTAX(1000);.
B.
You need to execute the command EXECUTE FUNCTION calctax;
C.
You need to create a SQL *Plus environment variable X and issue the command :X := CALCTAX(1000);.
D.
You need to create a SQL *Plus environment variable X and issue the command EXECUTE :X := CALCTAX;
E.
You need to create a SQL *Plus environment variable X and issue the command EXECUTE :X := CALCTAX(1000);
Explanation:
When you call a function from SQL*PLUS you need to assign the returned value a bind variable, and you need the EXECUTE command to execute the function.