##  An example of PL/SQL cursor variables within a Pro*C program 


    Pro*C Module
    ++++++++++++

    ...
    struct emp_rec {
       char   name [31];
       double emp_no;
    } emp_rec;
    ...
    SQL_CURSOR c;
    EXEC SQL ALLOCATE :c;
    EXEC SQL EXECUTE
         BEGIN  Emp_Pck.Open_Cur (:c);  END;
    END-EXEC;
    ...
    while (1)
    {  ...
       EXEC SQL FETCH :c into :emp_rec;
       ...
       break;
    }
    ...
    EXEC SQL CLOSE c;
    ...


    STORED PROCEDURE
    ++++++++++++++++

    ...
    Create or replace Package Emp_Pck IS
       Type emp_rec IS RECORD (name   emp.name%type,
                               emp_no emp.emp_no%type);
       Type emp_cur IS CURSOR  return emp_rec;
       Procedure Open_Cur ( C1 IN OUT emp_cur);
       ...
    END;

    Create or replace Package body Emp_Pck IS
       Procedure Open_Cur ( C1 IN OUT emp_cur);
       BEGIN
         OPEN C1 for Select name, emp_no from EMP;
       END;
       ...
    END;
