3
3
Mark for Review (1) Points DML statements only. SELECT statements only. DML statements and SELECT statements which return a single row. (*) COMMIT and ROLLBACK statements only. Incorrect Refer to Section 3 Lesson 3. Section 3 Lesson 3 2. There are three employees in department 90. What will be displayed when th e following code is executed? DECLARE v_open CHAR(3) := 'NO'; BEGIN UPDATE emplo yees SET job_id = 'ST_CLERK' WHERE department_id = 90; IF SQL%FOUND THEN v_open := 'YES'; END IF; DBMS_OUTPUT.PUT_LINE(v_open ' ' SQL%ROWCOUNT); END; Mar k for Review (1) Points NO 3 YES 1 YES 3 (*) Nothing will be displayed. The block will fail because you cannot use implic it cursor attributes directly in a call to DBMS_OUTPUT.PUT_LINE.
3. You can use implicit cursor attributes such as SQL%ROWCOUNT directly insid e a DML statement. For example: INSERT INTO log_table VALUES (SYSDATE, USER, SQL%ROWCOUNT); True or False? Mark for Review (1) Points True False (*)
4. Which of the following SQL DML commands can be used inside a PL/SQL block? Mark for Review (1) Points INSERT and UPDATE only.
UPDATE and DELETE only. INSERT, UPDATE and DELETE only. INSERT, UPDATE, DELETE and MERGE. (*) 5. Employee_id 999 does not exist. What will happen when the following c ode is executed? DECLARE employee_id employees.employee_id%TYPE := 999; BEGIN UPDATE employees SET salary = salary * 1.1 WHERE employee_id = employee_id; END; Mark for Review (1) Points No rows are updated but the block completes successfully. Every employee row is updated. (*) An exception is raised because you cannot give a variable the same name as a table column. An exception is raised because the UPDATE statement did not modify any rows. Which implicit cursor attribute identifies the number of rows updated in the following statement? DBMS_OUTPUT.PUT_LINE (__________ Mark for Review (1) Points SQL%COUNT SQL%NUMBER SQL%ROWCOUNT (*) SQLROW%COUNT 7. A PL/SQL block contains the following DML statement: UPDATE wf_countries SET population = population * 1.1 WHERE country_id = 229; Which kind of cursor is used for this statement? Mark for Review (1) Points An implicit cursor named "WF_COUNTRIES". An implicit cursor named "SQL". (*) An explicit cursor named "SQL". ' rows updated.');
An explicit cursor which must be declared and named by the PL/SQL programmer .