Updating tables within cursor loop

Perform whatever processing is required on the row.

updating tables within cursor loop-77

By extending SQL, PL/SQL offers a unique combination of power and ease of use.

In addition to static SQL discussed in this chapter, PL/SQL also supports dynamic SQL, which enables you to execute SQL data definition, data control, and session control statements dynamically.

Because a cursor is an actual object inside the database engine, there is a little overhead involved in creating the cursor and destroying it.

Also, a majority of cursor operations occur in tempdb, so a heavily used tempdb will be even more overloaded with the use of cursors.

In a previous Tech Republic column about SQL Server 2005, I showed how you can convert some of your iterative queries (cursors) to set-based operations in order to enhance performance.

Last modified 14-Mar-2016 12:40