what is cursor ? where we use cursor ?
what is cursor ? where we use cursor ?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Satyapriya NayakPosted Jul 16, 2012, 9:23 AM
Cursors allow row-by-row processing of the result sets.
Types of cursors: Static, Dynamic, Forward-only, Keyset-driven.
Disadvantages of cursors: Each time you fetch a row from the cursor, it results in a network roundtrip, where as a normal SELECT query makes only one roundtrip , however large the resultset is. Cursors are also costly because they require more resources and temporary storage (results in more IO operations). Further, there are restrictions on the SELECT statements that can be used with some types of cursors.
Most of the times, set based operations can be used instead of cursors.
Please refer the below link for the example of Types of cursors
http://www.dotnet-tricks.com/Tutorial/sqlserver?id=RLID060512&title=SQL%20Server%20-%20Types%20of%20Cursors
Thanks
SenthilkumarPosted Jul 17, 2012, 2:24 AM
when you have a requirement to iterate the sql server table or views to fetch the row by row then cursor needs to achieve this operation.
Jignesh TrivediPosted Jul 16, 2012, 11:44 PM
A cursor is a set of rows together with a pointer that identifies a current row.
Simply when you want to perform Row by row Opration on SQL Table or query then you may use Cursor.
please refer
http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=%2Fcom.ibm.db2.udb.apdv.sql.doc%2Fdoc%2Fc0024361.htm
http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=%2Fcom.ibm.db2.udb.apdv.sql.doc%2Fdoc%2Fc0024361.htm
hope this will help you.