A Brief Analysis of Database Cursors (Oracle)
A Brief Analysis of Database Cursors (Oracle) the Cursor concept The cursor is a memory work area of SQL, which is defined by the system or the user in the form of variables. The function of the cursor is to temporarily store the data blocks extracted from the database. Why use a cursor? The data of the database is stored in the disk, and the cursor transfers the data from the disk to the computer memory for processing, and finally displays the processing results or finally writes them back to the database, which can improve the efficiency of data processing, because frequent disk data Swapping reduces efficiency. There are two types of cursors: implicit cursors and explicit cursors. Implicit cursor: For SELECT…INTO… statements (only one row of records can be extracted from the database at a time) and DML (data manipulation language, that is, INSERT statements, UPDATE statements and DELETE statements), the system will use implicit cursors . Display cursor: For a SELECT statement with more than one record in the result set, the programmer needs to define a display cursor. the implicit cursor Four properties of implicit cursors %FOUNT The value true indicates that the single-line query statement or…