Today, we will briefly summarize the usage of cursor in PL/SQL.
Cursor category:
-- Explicit cursor-- Static cursor |
| -- Implicit cursorCursor |-- Strong type (Restriction), specifying the return type-- Dynamic Cursor -- ref cursor |-- Weak type
The difference among Cursor, hidden Cursor, and dynamic Ref Cursor is displayed in PLSQL. plsqlref1. Explicit cursorExplicit is relative to implicit cursor, that is, there is a clear declared cursor. The declaration of an explicit cursor is similar
Transferred from: http://developer.hi.baidu.com/#/detail/15344654this day's simple summary of the usage of cursor (cursor/cursor) in pl/ SQL.
I believe many DBAs who are engaged in development or maintenance have encountered similar face-to-face
I. EXPLICIT cursorExplicit is relative to the implicit cursor, which is the cursor with a clear declaration. The declaration of an explicit cursor is similar to the following (the detailed syntax participates in PLSQL ref doc):Cursor cursor_name
Today, we will briefly summarize the usage of cursor in PL/SQL.
I believe many DBAs who are engaged in development or maintenance have encountered similar face-to-face problems when looking for a job: Please briefly describe the type of the cursor,
I. EXPLICIT cursorExplicit is relative to the implicit cursor, that is, there is a clear declaration of the cursor. The declaration of an explicit cursor is similar to the following (specific syntax for Plsql ref doc):Cursor cursor_name (parameter
I. EXPLICIT cursorExplicit is relative to the implicit cursor, that is, there is a clear declaration of the cursor. The declaration of an explicit cursor is similar to the following (specific syntax for Plsql ref doc):Cursor cursor_name (parameter
Using ref cursor, you canProgramInter-pass result set (a program opens the cursor variable and processes data in another program ).You can also use ref cursor to implement bulk SQL to improve SQL Performance.
There are two types of ref cursor:
Oracle ref cursor and sys_refcursor, refsys_refcursor
1. Customize ref cursor and sys_refcursor;2. sys_refcursor is used as the parameter to pass the result set;3. ref cursor is used as the parameter to pass the result set;
1. Custom ref cursor
1. Custom ref cursor and sys_refcursor;2. Sys_refcursor as a parameter to pass the result set;3. The REF CURSOR is passed as a parameter to the result set;1. Custom REF CURSOR and Sys_refcursor: Declare Type df_ref is REF CURSOR; --Define REF
REF cursor is the reference of the result set that we define on the server side. When we open a REF cursor, no data is returned to the client, instead, the address of the data on the server will be returned to the client. This allows the user to
Oracle provides ref CURSOR, which enables the ability to pass result sets between programs, and can also implement bulk SQL using ref CURSOR to improve SQL performance.
Use the Scott User's EMP table to implement the following test cases:
Sql>
SourceSummary: 1, how to use the Function Import feature in the Entity Framework.2, shows how to use Odp.net's implicit REF cursor binding (implicit REF cursor binding).Environment and tools:Windows 10 Enterprise EditionMicrosoft Visual Studio
Reference variable--Variable used to store the value pointer
Cursor variable(Ref cursor)
When using a cursor, you do not need to specify the corresponding SELECT statement when defining the cursor.
When the cursor is open (when the
This article introduces the REFCursor usage in oracle. If you want to use REFCursor, refer to the example.
This article introduces the REF Cursor usage in oracle. If you need it, refer to the example.
This article introduces the REF Cursor usage in
1, what is a REF CURSOR?A temporary object that dynamically associates a result set. That is, dynamically deciding to execute the query at run time.What is the effect of 2,ref cursors?Implements the ability to pass result sets between programs,
1. What is a cursor?① Retrieve the result set from the table and point to a record for interaction at a time.② Operations in relational databases are performed on the complete set of rows.The row set returned by the SELECT statement includes all
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.