CURSOR is also called a CURSOR. It is often used in relational databases. In PL/SQL programs, you can use CURSOR and SELECT to query data in tables or views and read data row by row. Oracle cursors include display cursors and implicit cursors. Explicit Cursor: The Cursor defined in the PL/SQL program for query is called a display Cursor. Implicit Cursor: A Cursor automatically allocated by the Oracle system when UPDATE/DELETE statements are not defined in PL/SQL programs and used in PL/SQL. I. show cursor 1. use step (1) define (2) Open (3) Use (4) Close 2. first, CREATE the test table student. The script is as follows: create table "STUDENT" ("STUNAME" VARCHAR2 (10 BYTE), "STUNO" VARCHAR2 (4 BYTE ), "AGE" NUMBER, "GENDER" VARCHAR2 (2 CHAR) (1 ). use the WHILE loop to process the cursor create or replace PROCEDURE PROC_STU1 as begin -- display the cursor usage, and use the while LOOP declare -- 1. defines the cursor, named cur_stu cursor cur_stu is select stuno, stuname from student order by stuno; -- defines the variable and stores the data retrieved from the cursor v_stuno varchar (4); v_stuname varchar (20 ); begin -- 2. open cur_stu; -- 3. extract the current row of the cursor and store it in the variable fetch cur_stu into v_stuno, v_stuname; while cur_stu % found -- the cursor indicates that there are data rows, continue loop -- print the result dbms_output.PUT_LINE (v_stuno | '->' | v_stuname); -- continue to extract the current row referred to by the cursor into the variable fetch cur_stu into v_stuno, v_stuname; end loop; close cur_stu; -- 4. close the cursor end; END PROC_STU1; (2 ). use IF .. ELSE replaces the while loop processing cursor create or replace PROCEDURE PROC_STU2 as begin -- display cursor usage, use if to judge declare -- 1. defines the cursor, named cur_stu cursor cur_stu is select stuno, stuname from student order by stuno; -- defines the variable and stores the data retrieved from the cursor v_stuno varchar (4); v_stuname varchar (20 ); begin -- 2. open cur_stu; Author: wangliya110