Question 59 you have a row level before update

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: on triggers are developed using Oracle client-side tools, such as Oracle Forms Developer. QUESTION 59: You have a row level BEFORE UPDATE trigger on the EMP table. This trigger contains a SELECT statement on the EMP table to ensure that the new salary value falls within the minimum and maximum salary for a given job title. What happens when you try to update a salary value in the EMP table? A. The trigger fires successfully. B. The trigger fails because it needs to be a row level AFTER UPDATE trigger. - The Power of Knowing 1Z0-147 C. The trigger fails because a SELECT statement on the table being updated is not allowed. D. The trigger fails because you cannot use the minimum and maximum functions in a BEFORE UPDATE trigger. Answer: C Explanation: This will result in a mutating table. A mutating table is a table against which a data manipulation statement has been issued and the corresponding trigger on the DML statement is reading from the same table, at the same time. To work around this you would need to need to create a statement level trigger with the SELECT statement and place the values into the package variables. Then the ROW Level Trigger could check the values in the package variables. Incorrect Answers A. This trigger would result in a mutating table and would generate an error. B. ROW level Triggers result in a mutating table, STATEMENT level triggers do not. D. You may use a MINIMUM and MAXIMUM Functions but not in a ROW level Trigger that queries the same table in which a DML operation is being performed. QUESTION 60: 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_salaryNUMBER; 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 i...
View Full Document

This document was uploaded on 03/08/2014.

Ask a homework question - tutors are online