The database cursor easily enters database series 9

Source: Internet
Author: User
Cursor: A cursor provides a flexible way to operate the data retrieved from a table. In essence, A cursor is actually a mechanism that can extract a record from a result set that contains multiple data records. The cursor is always associated with an SQL selection statement because the cursor is retrieved by the result set (which can be zero, one or more of the selected statements.

Cursor: A cursor provides a flexible way to operate the data retrieved from a table. In essence, A cursor is actually a mechanism that can extract a record from a result set that contains multiple data records. The cursor is always associated with an SQL selection statement because the cursor is retrieved by the result set (which can be zero, one or more of the selected statements.

Cursor Concept: A cursor provides a flexible means to operate the data retrieved from a table. In essence, A cursor is actually a mechanism that can extract a record from a result set that contains multiple data records. A cursor is always associated with an SQL selection statement because it is a result set (it can be zero, one, or multiple records retrieved by the relevant selection statement) and the cursor position in the result set pointing to a specific record. When processing a result set, a cursor pointing to the result set must be declared.

Personal Understanding:

Cursor: select a temporary bucket for storing data based on your needs. In this bucket, you can access and operate data based on the type of the bucket. It can also be said that the cursor is the result set of multiple records retrieved based on an SQL statement. We put these results together because we need to perform operations on these result sets one by one.

Cursor type: static, dynamic, keyset-driven, only-in. These four types can be further refined. We usually use several of them.

Read-only, scrollable, only-in, and updatable. These can be combined to form a new type of cursor.

Cursor operation data: four steps: 1. Define a cursor: declare the cursor name, type, and data source.

Ii. Open the cursor

3. Push cursor: Fill in the data obtained from the definition cursor to the cursor.

4. Close the cursor: Clear the space.

Syntax:


A cursor is like a scroll wheel lock: the scroll wheel lock has a pair of verses and a pair of numbers. This is the data source we choose. If you choose a password lock for poetry, it is filled with this lock wheel is a line of poetry. If you select a digital password lock, the verse is replaced with a number. However, we can only see a row of information at a time. We can find the information we need by turning one row at a time.

Poetry password lock:



Digital password lock:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.