Oracle Dynamic Cursors

Source: Internet
Author: User

Declare
V_col1 varchar2 (254);
V_col2 varchar2 (254);
V_sql VARCHAR2 (1024);


Type my_cursor is REF CURSOR;
V_cur My_cursor;
Begin
V_sql: = ' select:1,:2 from dual where 1 =: 3 ';
Open V_cur for V_sql
Using ' col1 ', ' col2 ', 1;
Loop
Fetch V_cur
into V_col1, v_col2;
Exit when V_cur%notfound;

Dbms_output.put_line (V_col1 | | "| | V_COL2);

End Loop;
Close v_cur;

End

the properties of an explicit cursor include:
the properties of the cursor     return value type   meaningrighteousness%rowcount      Integral type         gets the number of data rows returned by the FETCH statement%found         Boolean type        The most recent FETCH statement returns a row of data or is true, otherwise false%notfound      Boolean type        Contrary to the%found property return value%isopen        Boolean type       The cursor has been opened for true, otherwise false

Oracle Dynamic Cursors

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.