How to avoid using cursors? What to use instead of cursor and in what cases to do so?



How to avoid using cursors? What to use instead of cursor and in what cases to do so?..

Answer / Umesh Kumar Jaiswal

To avoid using cursors, you can utilize collection types such as arrays or tables. These methods are more efficient for large datasets. Instead of a cursor loop, you might employ a Bulk Collect operation to reduce the number of round trips between PL/SQL and the database. This technique is particularly useful when dealing with multiple rows at once. However, it's essential to consider the complexity of your code and the size of your dataset when deciding whether to use cursors or collections.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

In a distributed database system, can we execute two queries simultaneously?

1 Answers  


Why do we use sql constraints?

1 Answers  


How is pl sql different from sql?

1 Answers  


What is coalesce in sql?

1 Answers  


What is the difference between nested table and varray?

1 Answers  


Enlist the data types that can be used in pl/sql?

1 Answers  


what is explain plan?

4 Answers  


how to fetch alternate records from a table? : Sql dba

1 Answers  


What are different types of statements supported by sql?

1 Answers  


What are indexes, and what are the different types?

3 Answers  


Is it possible to include an insert statement on the same table to which the trigger is assigned?

1 Answers  


how to eliminate null values in a column i.e table vlaues 1 2 3 NULL 3 4 1 5 NULL i want output like this 1 2 3 3 4 1 5 i dnt want to use nvl is null and i dnt want replace the NULL value with any value i.e nvl(col,o);

11 Answers   Satyam,


Categories