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 |
In a distributed database system, can we execute two queries simultaneously?
Why do we use sql constraints?
How is pl sql different from sql?
What is coalesce in sql?
What is the difference between nested table and varray?
Enlist the data types that can be used in pl/sql?
what is explain plan?
how to fetch alternate records from a table? : Sql dba
What are different types of statements supported by sql?
What are indexes, and what are the different types?
Is it possible to include an insert statement on the same table to which the trigger is assigned?
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);
Oracle (3253)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)