Cursor Advantages and Disadvantages

What are the uses of Cursor?
What are its advantage and disadvantage?

Questions by sri3241

Showing Answers 1 - 24 of 24 Answers

Disadvantages:


Using implicit/explicit cursors are depended by Situation.

If the result set is less than 50 or 100 records it is better to go for implicit cursors. if the result set is large then you should use explicit cursors. other wise it will put burden on CPU

  Was this answer useful?  Yes

kittu408

  • Feb 1st, 2011
 

ad:using of cursor ,plsql program can control the context area as sql query result being process
disad:using of cursors we connot go backword (i.e i cannot go to frist record ofter plsql fetch five records form cursor  )

  Was this answer useful?  Yes

Cursor advantages:


--> Using cursor to getting multiple values.
--> One cursor have multiple select statements
--> Cursor parameters 
       i.e cursor cursor_name (parameter datatype)
            is 
            select * from table_name
            where(condition)
-->Where Current of Clause: this is use full when the primary key is not present.

Cursor disadvantages:

-->It is returned by only one row at a time.
--> It gives less performance
-->Each time we fetch a row from the cursor, where as a normal cursor select statement query makes only one trip.         

  Was this answer useful?  Yes

Phani Kumar

  • Jul 24th, 2014
 

Dis Advantage of Cursors

A cursor is a memory resident set of pointers -- meaning it occupies memory from your system that may be available for other processes. Poorly written cursors can completely deplete available memory. Means it consumes more Resources

Advantage of Cursors

Cursors can be faster than a while loop but they do have more overhead. Another advantage is that it is we can do RowWise validation or in other way you can perform operation on each Row.It is a Data Type which is used to define multivalue variable.

  Was this answer useful?  Yes

Manoj Singh

  • Jun 25th, 2015
 

Strongely Suggested aviod to use cursor becuase it is very slow, if you have good knowledge of joins you can replace cursor with join

  Was this answer useful?  Yes

Maneesh Kanaujia

  • Jun 26th, 2015
 

Best way to define disadvantage of cursor is context switching, if the execution switches from PLSQL engine to SQL engine and vise versa, then execution time will increase and finally end up with longer time to complete the whole process.

  Was this answer useful?  Yes

WebSpider

  • Feb 11th, 2016
 

Performance is reduced using cursor

  Was this answer useful?  Yes

Habib Ali

  • May 10th, 2016
 

Advantage: Gets multiple-data inside the buffer cache, for faster DML operations

Disadvantage: Consumes memory, has to be freed properly to avoid Buffer cache congestion

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions