Examine this code:
CREATE OR REPLACE STORED FUNCTION get_sal
(p_raise_amt NUMBER, p_employee_id employees.employee_id%TYPE)
RETURN NUMBER
IS
v_salary NUMBER;
v_raise NUMBER(8,2);
BEGIN
SELECT salary
INTO v_salary
FROM employees
WHERE employee_id = p_employee_id;
v_raise := p_raise_amt * v_salary;
RETURN v_raise;
END;
Which statement is true?
A.
This statement creates a stored procedure named get_sal.
B.
This statement returns a raise amount based on an employee id.
C.
This statement creates a stored function named get_sal with a status of invalid.
D.
This statement creates a stored function named get_sal.
E.
This statement fails.
Explanation:
This statement will fail. Remove the STORED from CREATE OR REPLACE STORED
FUNCTION
Incorrect Answers:
A: This statement is attempting to create a Function
B: If there was not a syntax error, this function would return a raise amount based on the raise
amount & employee id passed to the function.C. The incorrect syntax will prevent the function from
being created with a status of invalid.D. The incorrect syntax will prevent the function from being.