nerdexam
Oracle

1Z0-147 · Question #23

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…

The correct answer is E. This statement fails. See the full explanation below for the reasoning.

Question

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?

Options

  • AThis statement creates a stored procedure named get_sal.
  • BThis statement returns a raise amount based on an employee id.
  • CThis statement creates a stored function named get_sal with a status of invalid.
  • DThis statement creates a stored function named get_sal.
  • EThis statement fails.

How the community answered

(45 responses)
  • A
    7% (3)
  • B
    13% (6)
  • C
    2% (1)
  • D
    4% (2)
  • E
    73% (33)

Community Discussion

No community discussion yet for this question.

Full 1Z0-147 Practice