Cursor implementation in application, helps data manipulation easy and even they are very effective but due to some major disadvantage of Cursor normally they are not preferred.
*As we know cursor doing round trip it will make network line busy and also make time consuming methods. First of all select queries generate output and after that cursor goes one by one so round trip happen.
*Another disadvantage of cursor are there are too costly because they require lot of resources and temporary storage so network is quite busy.
Apart from these I would like to point out some great advantages of cursor if the entire result set must be transferred to the client for processing and display.
*Client-side memory : For large results, holding the entire result set on the client can lead to demanding memory requirements on client side system.
*Response time : Cursors can provide the first few rows before the whole result set is assembled. If you do not use cursors, the entire result set must be delivered before any rows are displayed by your application.
*Concurrency control :It's a general problem with current applications, If you make updates to your data and do not using cursors in your application, you must send separate SQL statements to the database server to apply the changes. This raises the possibility of concurrency problems if the result set has changed since it was queried by the client. In turn, this raises the possibility of lost updates.But Cursors act as pointers to the underlying data, and so impose proper concurrency constraints on any changes you make.
-
It is true that in some case we can avoid cursors by using PL SQL logics,I mean by implementing While loop,Tricky queries and through joins but they require great development logic.
No comments:
Post a Comment