adspace


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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Is primary key always clustered index?

1095


how to start mysql server? : Sql dba

1267


What is your daily office routine?

2346


Is primary key clustered index?

1019


what is sql server agent? : Sql dba

1182


What is the current version of sql?

1094


Hi am new to PLSQL & facing problems in writing code like in SP, Functions, so any one having some SP coding with in depth explanation please share with me my Email ID suvarnaatsuvarna@rediffmail.com Or taking tanning on this please do contact me

2091


how many tables will create when we create table, what are they? : Sql dba

1144


what are aggregate and scalar functions? : Sql dba

1129


Do we need to rebuild index after truncate?

1138


how to escape special characters in sql statements? : Sql dba

1114


what is collation? : Sql dba

1229


what is dbms? : Sql dba

1061


how to use regular expression in pattern match conditions? : Sql dba

1113


Does group by remove duplicates?

1112