Cursor in the SQL is the private working area, in fact every time you write a query to fetch data from the database an internal cursor is developed that fetch the data from the database and hold the data in it and then displays it to you.
Let me give you example, it is like a counter of pharmacy where you are allowed to present your prescription and not allowed to go in by your self and collect the medicine by your own. Same is the case of cursor because in order to minimize your interaction with the database it interact with database itself and you only deal with the cursor, but the whole process is so fast in SQL that you feel as if you are interacting with database directly and fetching direct from Tables.
Now the answer to your second part of question that why we should use cursors, some times you need to fetch data according to your choice in PL/SQL so you define explicit cursor, with explicit cursor you can combine LOOPS to get the data of you choice and even repeatedly same data as well. There are four phases of any cursor internal or external, DECLARE, OPEN , FETCH AND THEN CLOSE.
原文:http://science.blurtit.com/75320/what-is-a-cursor-and-why-should-you-use-a-cursor-in-sql
分享到:
相关推荐
ChatGPT研究资料,What Is ChatGPT Doing ... and Why Does It Work (Stephen Wolfram) (Z-Library)
没有人预料到这一点——甚至包括它的创造者:ChatGPT作为一种能够以令人信服的人类水平进行写作的AI已经出现在舞台上。但是它真正的工作原理是什么?其“AI大脑”内部发生了什么?在这本短篇书籍中,杰出科学家和...
3. What should you use if you want to get the value of a specific cell from a row in a datatable? 4. What happens if the AddHeaders option is checked for Read Range Activity? 5. What happens if you ...
A special feature of this edition is a new appendix on NoSQL and relational theory.Could you write an SQL query to find employees who have worked at least once in every programming department in the ...
28. Which numerical method should I use and when? 123 29. What is Monte Carlo Simulation? 132 30. What is the finite-difference method? 136 31. What is a jump-diffusion model and how does it affect ...
In this book, Chris Date explains relational theory in depth, and demonstrates through numerous examples and exercises how you can apply it to your use of SQL. This third edition has been revised, ...
coreos部署过程的ppt讲解。非常详细,具体的代码也在里面。
What You'ill Learn Build flexible applications that respond to changing business needs Take advantage of creative, innovative, and productive uses of dynamic SQL Know about SQL injection and be ...
Why should you use STL vector and string instead of arrays? How do you choose the right STL search or sort algorithm? What rules should you follow to ensure type-safe code? Whether you're working ...
根据文档,保证可以在45题中答对百分之七十。实验通过人数过百。 一下为其中部分题目: ...44. What should you use to click in a hidden IE browser? 45. Which recording profile generates full selectors?
(c) typing a syntactically correct SQL query that uses column and table names similar to the correct column and table names in a database (d) writing an English description of the data that the user...
Making Software - What Really Works, and Why We Believe It. Does the MMR vaccine cause autism? Does watching violence on TV make children more violent? Are some programming languages better than ...
What you'll learn What Drupal is and why you should use it How to install a basic Drupal web site from scratch How to create content in your new Drupal web site How to manage users on your new Drupal...
Why a security architecture, and what is the business case? Is it important to have a security architecture, or is it just another new hype? Who does it give added value to? Are there ...
and page faults are not allowed at this level or above, most device drivers use non-paged pool to assure that they do not incur a page fault. Represented by Memory: Pool Nonpaged Bytes, typically ...
What is Nucleus C++ FILE? Nucleus C++ FILE is a C++ class interface into Nucleus FILE, a FAT16/FAT32 TM compatible file system specifically designed to work in embedded systems in conjunction with the...
Each CSS chapter comes with an end-of-chapter exercise where you get to practice the different CSS properties covered in the chapter and see first hand how different CSS values affect the design of ...
WHAT IS A MATROID? JAMES OXLEY Abstract. Matroids were introduced by Whitney in 1935 to try to capture abstractly the essence of dependence. Whitney’s definition embraces a surprising diversity of ...
You will learn to use the connector by working through code examples and following a discussion of how the API calls work. By the end of the book, you will be able to use MySQL as the back-end ...
Learn what a microservices architecture is, its advantages, and why you should consider using one when starting a new application. The book describes how taking a microservices approach from the start...