hi all,
i was searching for the example of subject mentioned and visited the following website
http://docs.oracle.com/html/B10602_01/orbr_refcur.htm
here is a tutorial to create such report, but i am confused as here in Report's Data Model they created 3 Ref Cursor Queries and did not Close the opened cursor, is there no need of this or any mistake or if it necessary, where have to Close the cursor?
First, they have created following Packages
PACKAGE concl_cv IS
type conclass_rec is RECORD
(EMPLOYEE_ID NUMBER(6),
FIRST_NAME VARCHAR2(20),
LAST_NAME VARCHAR2(25),
e-mail VARCHAR2(25),
PHONE_NUMBER VARCHAR2(20),
HIRE_DATE DATE,
JOB_ID VARCHAR2(10),
SALARY NUMBER(8,2),
DEPARTMENT_ID NUMBER(4));
type conclass_refcur is REF CURSOR return conclass_rec;
END;
PACKAGE cont_cv IS
type container_rec is RECORD
(EMPLOYEE_ID NUMBER(6),
START_DATE DATE,
END_DATE DATE,
JOB_ID VARCHAR2(10),
DEPARTMENT_ID NUMBER(4));
type container_refcur is REF CURSOR return container_rec;
END;
PACKAGE port_cv IS
type portdesc_rec is RECORD
(DEPARTMENT_ID NUMBER(4),
DEPARTMENT_NAME VARCHAR2(30));
type portdesc_refcur is REF CURSOR return portdesc_rec;
END;
then, created Functions which created in Ref Cursor Query in Data Model
function q_portdescRefCurDS return port_cv.portdesc_refcur is
temp_portdesc port_cv.portdesc_refcur;
begin
open temp_portdesc for select department_id, department_name from departments;
return temp_portdesc;
end;
function q_containerRefCurDS return cont_cv.container_refcur is
temp_container cont_cv.container_refcur;
begin
open temp_container for
select employee_id,
start_date,
end_date,
job_id,
department_id
from job_history;
return temp_container;
end;
function q_conclassRefCurDS return concl_cv.conclass_refcur is
temp_concl concl_cv.conclass_refcur;
begin
open temp_concl for
select employee_id,
first_name,
last_name,
e-mail,
phone_number,
hire_date,
job_id,
salary,
department_id
from employees;
return temp_concl;
end;
nothing here any Close cursor statement. please help.
i am trying to explore this area of the development.
thanks in advance.