Database - Explain in brief the cursor optimization tips

Explain in brief the cursor optimization tips.

1) Close cursor when it is not required.
2) You shouldn’t forget to deallocate cursor after closing it.
3) You should fetch least number of records.
4) You should use FORWARD ONLY option when there is no need to update rows.

Explain in brief the cursor optimization tips.

The following are few tips for cursor optimization:

- When the cursor is not needed, close the cursor
- Deallocate the cursor after closing it.
- Fetch less number of rows.
- Avoid triggers – because trigger executes whenever data gets updated, leads to overload of the system.
- When the rows are not need to update, use the option FORWARD ONLY
- Use where instead of having clause unless it is essential
Database - What is sub-query?
A query within a query is defined as a sub-query. A sub query is executed by enclosing it within another query....
Database - Explain the use of group by clause
Group By" is used to derive aggegate values by grouping similar data.....
Database - Difference between clustered and non-clustered index
A clustered index is unique for a given table. The actual data is at the leaf level of a clustered index and data is resorted......
Post your comment