oracle cursor attributes used

2011-09-15  来源:本站原创  分类:Database  人气:100 

Oracle Cursor property :

%FOUND: Variables finally get records from the cursor when a record in the result set found .

%NOTFOUND: Variables last from the cursor gets record when, in the result set has no records found .

%ROWCOUNT: Current moment from the cursor gets record number .

%ISOPEN: Is open .

Description:

Wrote

When executing a DML statement, DML statements results in setting the four cursor attributes, these attributes are used to control program flow, or understand the state of the program. When you run DML statements, PL / SQL to open a built-in cursor and process the results, the cursor is to maintain the query results in a memory area, the cursor open when you run DML statements, complete closure. Implicit cursors using only SQL% FOUND, SQL% NOTFOUND, SQL% ROWCOUNT three properties. SQL% FOUND, SQL% NOTFOUND is a Boolean value, SQL% ROWCOUNT is an integer value.

SQL% FOUND and SQL% NOTFOUND

Before performing any DML statement in SQL% FOUND and SQL% NOTFOUND of the values are NULL, the implementation of DML statement, SQL% FOUND attribute value will be:
. TRUE: INSERT

. TRUE: DELETE and UPDATE, DELETE, or at least one line is UPDATE.

. TRUE: SELECT INTO returns at least one line

When the SQL% FOUND is TRUE, SQL% NOTFOUND to FALSE.

SQL% ROWCOUNT

Before performing any DML statement, SQL% ROWCOUNT value is NULL, the SELECT INTO statement, if executed successfully, SQL% ROWCOUNT value of 1, if not successful, SQL% ROWCOUNT is 0, while producing an exception NO_DATA_FOUND .
SQL% ISOPEN

SQL% ISOPEN is a Boolean value, if the cursor is opened, for the TRUE, if the cursor is closed, compared to FALSE. For the purposes of the implicit cursor SQL% ISOPEN always FALSE, because the implicit cursor open in the DML statement is executed, immediately turn off the end.

相关文章
  • oracle cursor attributes used 2011-09-15

    Oracle Cursor property : %FOUND: Variables finally get records from the cursor when a record in the result set found . %NOTFOUND: Variables last from the cursor gets record when, in the result set has no records found . %ROWCOUNT: Current moment from

  • Oracle cursor using the lessons learned 2011-06-28

    The following article is to introduce the Oracle cursor use, the following is a description of specific programs, hoping to learn in the future you will help. First, we use a SELECT statement, which is used to query data from the database, when the P

  • Oracle cursor using Daquan 2010-04-08

    Inquiry SELECT Statement used to query data from the database, when in PL/SQL When used in SELECT statement , Used in conjunction with the INTO clause , Check the return value is assigned a variable INTO clause , Variable in the statement is DELCARE

  • oracle cursor Introduction 2010-04-18

    Cursor cursor literal understanding is swimming. Database language used to describe: the cursor result set row is the mapping data in the location of entities, with the cursor, the user can access any row result set, and will place the cursor to a ce

  • Oracle cursor using the Encyclopaedia (personal collection order) 2010-06-17

    / * Inquiry SELECT statement is used to query data from the database, when the PL / SQL, use the SELECT statement, used in conjunction with the INTO clause, Check the return value is assigned INTO clause in the variables Variable in the statement is

  • oracle cursor Summary 2010-09-01

    Area of the environment to handle cursor is a SQL statement oracle storage area. Cursor is a pointer to it or handle. Through the cursor, PL / SQL program can control the environment in the region are processed statements. Oracle cursor in two ways:

  • The use of an Oracle cursor 2010-11-11

    What is a cursor Cursor is literally swimming in the cursor. Database language used to describe: the cursor is a line in the result set mapping the location of physical data, with the cursor, the user can access any of the result set row, and place t

  • simple rules to use oracle cursor 2011-04-13

    oracle cursor Recent oracle of a new understanding of the cursor so write to share to share. Through the select statement query, the returned results are usually composed of a collection of multi-line records. This programming language is concerned,

  • Chapter 6 Oracle cursor 2011-05-13

    Chapter 5 Using Oracle PL / SQL Chapter 7 Oracle subroutine package Chapter 6 Oracle cursor 1, the technical objectives Use the cursor 2, What is a cursor? When the cursor is pointing to the query result set data pointer, can visit through the cursor

  • [Essence] Oracle cursor using Daquan 2011-09-28

    We will discuss the DDL used to access the ORACLE database and TCL statement. Inquiry SELECT statement is used to query data from the database, when the PL / SQL using the SELECT statement, used in conjunction with the INTO clause, the query is assig

  • Oracle cursor using Daquan (transfer) 2011-10-27

    We will discuss a variety of used to access the ORACLE database DDL and TCL statement. Inquiry SELECT statement is used to query data from the database, when the PL / SQL using the SELECT statement, to be used in conjunction with the INTO clause, the

  • Oracle cursor usage summary 2011-07-17

    Cursor (CURSOR), also known as the cursor in a relational database is often used in PL / SQL programs can use CURSOR with SELECT on the table or view data query and read line by line. Oracle cursor into display cursor and implicit cursor. Display cur

  • In Oracle Cursor (cursor) to learn 2010-11-11

    The concept SQL cursor is a memory work area, or by the system user to define the form of a variable. The role of the cursor is used to temporarily store data extracted from the database block. In some cases, the data stored in the disk from the tabl

  • Detailed use oracle cursor 2011-04-27

    Cursor (CURSOR), also known as the cursor in a relational database is often used in PL / SQL programs can use CURSOR with SELECT on the table or view data query and read line by line. Oracle cursor into display cursor and implicit cursor. Display cur

  • oracle cursor through the records% rowtype 2011-08-20

    Then we use the Oracle cursor Cursor is divided into: static cursor and reference cursor (dynamic cursor) Static cursors: user-defined (implicit cursor, cursor display) the result set unchanged Reference cursor cursor: changes in the result set Impli

  • In Oracle Cursor (cursor) 2011-08-30

    Sql cursor is the concept of a memory work area, or by the system users in the form of variable definition. The role of the cursor is used to temporarily store data extracted from the database block. In some cases, the data stored in the disk from th

  • Oracle cursor learning 2010-06-18

    DECLARE t_a VARCHAR2(50); CURSOR cur_b(t_c VARCHAR2)IS SELECT d4.d401_02 FROM d401 d4 WHERE d4.d401_01 = t_c ; BEGIN OPEN cur_b('410126197904190319'); LOOP FETCH cur_b INTO t_a ; EXIT WHEN cur_b%NOTFOUND; dbms_output.put_line(t_a); END LOOP; CLOSE cu

  • oracle cursor parameters 2010-04-22

    1, the parameter cursor Parameters with the parameters of a cursor is the cursor, the cursor after the definition of parameters, different parameter values when using multiple open cursor, you can produce different result sets, the syntax is as follo

  • Oracle cursor using the reference statement 2010-09-06

    A simple and practical: Declare -- Declare a cursor Cursor Mycur Is Select * From Emp; Empinfo Emp%Rowtype; Cou Number; Begin -- Cursor operations using a loop, but before you open the cursor must be For Empinfo In Mycur Loop Cou := Mycur%Rowcount; D

  • simple oracle stored procedure syntax and examples. oracle exception. oracle cursor 2011-01-05

    Qracle PL/SQL -- Stored procedure 1.PL/SQL SQL Mandarin is a database, each database in the realization of SQL International standards, also has its own unique statement .(Hibernate dialect) Communication standards :ODBC(ado , ado.net),JDBC(jdo , Hib