Defines and declares a reference cursor before explicitly opening it : Reference Cursor « Cursor « Oracle PL / SQL






Defines and declares a reference cursor before explicitly opening it

  
SQL>
SQL> DECLARE
  2  TYPE weakly_typed IS REF CURSOR;
  3  quick WEAKLY_TYPED;
  4  BEGIN
  5    OPEN quick FOR
  6      SELECT   item_title
  7      ,        COUNT(*)
  8      FROM     item
  9      HAVING  (COUNT(*) > 2)
 10      GROUP BY item_title;
 11    :refcur := quick;
 12  END;
 13  /
SP2-0552: Bind variable "REFCUR" not declared.
SQL>

   
    
  








Related examples in the same category

1.Define and use reference cursor
2.REF CURSOR custom type
3.Reference cursor demo
4.Reference value in a cursor by cursor variable
5.Set the REFCURSOR variable to the results of a SELECT statement, and print out the REFCURSOR variable
6.refcursor variable