Examine this code:
CREATE OR REPLACE PROCEDURE add_dept
( p_name departments.department_name%TYPE DEFAULT
‘unknown’,
p_loc departments.location_id%TYPE DEFAULT 1700)
IS
BEGIN
INSERT INTO departments(department_id, department_name, loclation_id)
VALUES(dept_seq.NEXTVAL,p_name, p_loc);
END add_dept;
/
You created the add_dept procedure above, and you now invoke the procedure in SQL *Plus.
Which four are valid invocations? (Choose four)
A.
EXECUTE add_dept(p_loc=>2500)
B.
EXECUTE add_dept(‘Education’, 2500)
C.
EXECUTE add_dept(‘2500’, p_loc =>2500)
D.
EXECUTE add_dept(p_name=>’Education’, 2500)
E.
EXECUTE add_dept(p_loc=>2500, p_name=>’Education’)
Explanation:
A: This statement correctly uses named notation. A Default value is defined for both parameters in the procedure so it is not necessary to pass any parameters. B: This statement correct uses positional notation.
C: This statement correctly uses mixed notation.
E: This statement correctly uses named notation.
Incorrect Answers
D: When using mixed notation to pass the values, all the parameters specified with positional notation
must precede the parameters specified with named notation in the subprogram call. If the parameters specified with positional notation do not precede the parameters specified with named
notation, the following error is generated at run time:
PLS-00312: a positional parameter association may not follow a named