XXX Chats

need help with consolidating financial statements

Sql procedure loop while updating records using cursors

Part 12 in a series of articles on understanding and using PL/SQL The central purpose of the Oracle PL/SQL language is to make it as easy and efficient as possible to query and change the contents of tables in a database.

You must, of course, use the SQL language to access tables, and each time you do so, you use a to get the job done.

If there is no such row, the block will fail with an unhandled NO_DATA_FOUND exception.

When that bonus pool is exhausted, it stops fetching and commits all changes.

In this case, there is just a single column value, so you could just as easily have declared l_employee_id as employees.employee_id%TYPE.

But whenever you use an explicit cursor, it is best to declare a record by using %ROWTYPE, so that if the SELECT list of the cursor ever changes, that variable will change with it.

This article focuses on the most-common ways programmers execute SELECT statements in PL/SQL, namely At the end of the article, I offer some quick tips to help you figure out which of these techniques you should use for different scenarios.

SELECT-INTO offers the fastest and simplest way to fetch a single row from a SELECT statement.

Comments Sql procedure loop while updating records using cursors