Advertisement
hjysy

What is a Database Cursor?

Mar 20th, 2019
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. What is a Database Cursor?
  2.  
  3. ++++++++++++++
  4. If You want to buy cheap web hosting then visit http://listtop.pw and select the cheapest hosting. it can be suitable for all your needs.
  5.  
  6. Top 200 best traffic exchange sites http://listtop.pw/surf
  7.  
  8. Listtop.pw
  9. Listtop.pw
  10. Listtop.pw
  11.  
  12. +++++++++++++++
  13. A database cursor is something like an indicator that you can use to hover on a specific row within a result of the inquiry. In a sense, it is a pointer that indicates the current row. You can move this indicator from one row to another, and depending on the type of cursor use, you can even move it back to the previous row.
  14.  
  15. A database cursor may be used in the following situation:
  16.  
  17. Statements that give back more than a single row of data coming from the database server. For instance, a statement like EXECUTE FUNCTION needs to utilize a function cursor while a statement indicating SELECT needs a select cursor.
  18. Statements indicating INSERT which actually transmits more than a single row of data towards the database server. This statement needs an insert cursor.
  19. TYPES OF CURSORS TO USE
  20.  
  21. Cursors go in two main categories: cursors for scrolling ability and cursors with skills for detecting changes made into the database.
  22.  
  23. There are two main scrolling abilities:
  24.  
  25. SCROLL
  26.  
  27. It is a cursor that can use operations which include FIRST, PRIOR, RELATIVE, LAST, NEXT and ABSOLUTE in order to steer the results.
  28.  
  29. FORWARD_ONLY
  30.  
  31. This kind of cursor begins at the first row and ends on the last row. In simpler terms, this cursor can only move to the next row of results.
  32.  
  33. DATABASE SENSITIVITY
  34.  
  35. In terms of the ability to detect changes in the database, there is a term called database sensitivity. Database sensitivity has different elements.
  36.  
  37. KEYSET
  38.  
  39. This cursor can view the changes that are actually made on the rows which are initially into cursor since these keys (unique row identifiers) are utilized in order to obtain rows during a cursor operation. This kind of cursor cannot view the rows that are added to the table.
  40.  
  41. STATIC
  42.  
  43. The changes made will not mirror in the cursor’s result. The changes made in the cursor’s data are also not permanent and are not stored in the underlying database tables
  44.  
  45. DYNAMIC
  46.  
  47. This is the complete opposite of STATIC as the changes made will be mirrored in the cursors.
  48.  
  49. Now that you know the basics of database cursors, you will surely know which type of cursors to choose for specific purposes.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement