XXX Chats

club dating single uk

Oracle cursor for updating every row in same table

Zero rows returning implicit cursor raises NO_DATA_FOUND exception, while multiple rows one raises TOO_MANY_ROWS exception.

Check the exception situations in the below screen dumps.

All SELECT statements and DML statements which affect single row, processed within PL/SQL block are classified as Single row implicit cursors.

All DML statements and cursor FOR loops, which affect multiple rows fall under the category of multiple row implicit cursors.

As the DML statement affects multiple rows, it demonstrates a multiple row implicit cursor.[box]BEGINUPDATE EMPLOYEESSET SALARY = SALARY (COMM*SALARY); END;[/box]These cursors are explicitly declared in the DECLARE section of the block.

They possess a specific name and a static SELECT statement attached to them.

Oracle 11g identifies a different categorization basis of implicit cursors.

oracle cursor for updating every row in same table-2

Implicit cursors, based on number of rows affected by the cursors, can be categorized as single row implicit cursors and multiple row implicit cursors.

Example Code [2]: The PL/SQL block below contains single SELECT statement which selects salary of a single employee.

Since, it returns a single row output, it demonstrates the construction of single row implicit cursor.[box]DECLAREL_SAL NUMBER; BEGINSELECT SALARYINTO L_SALFROM EMPLOYEESWHERE EMPLOYEE_ID=110; END;[/box]Example Code [3]: In the PL/SQL block below, UPDATE statement recalculates the salary of all employees in the company.

Explicit cursors are best suited in situations where number of records in the result set is not known.

It not only avoids the exception threat but also well indents the coding standards.

Comments Oracle cursor for updating every row in same table