preetham
09-03-2004, 04:14 AM
hi friends
The below procedure is exeecuting properly and displaying 37 records from SQLPLUS.
But the problem is The %rowcount in the procedure is showing only 0(Zero).
can u please help why it is returning 0 instead of 37 .
PROCEDURE p_region(chFlag VARCHAR2 DEFAULT 'C',norecords out number,
pc_Region IN OUT pkg_fe_base_dw.rc_datawindow ) IS
BEGIN
-- v_count := 0;
OPEN pc_Region FOR
SELECT rd_dv_cd,
rd_rg_cd,
rd_rg_sdesc,
rd_rg_ldesc,
nvl(ud_user_name,rd_created_by) rd_created_by,
rd_created_dt,
rd_end_dt, chFlag
FROM rtl_region_def a, rtl_user_Def z
WHERE ((chFlag='C' AND rd_end_dt IS NULL) OR (chFlag='H'))
AND a.rd_created_By = z.ud_user_id (+)
AND nvl(ud_most_recent_flag,'Y')='Y'
ORDER BY rd_rg_cd;
norecords := pc_region%rowcount;
--norecords := 1000;
dbms_output.put_line('no of records:-'|| pc_region%rowcount);
--If pc_region%rowcount = 0 then
--dbms_output.PUT_LINE(pc_region%rowcount);
--else
--bms_output.PUT_LINE('No Records to fetch');
--null;
--end if;
END;
END;
/
Thanks in advance.
preethamnorecords := pc_region%rowcount; 14 ariel
The below procedure is exeecuting properly and displaying 37 records from SQLPLUS.
But the problem is The %rowcount in the procedure is showing only 0(Zero).
can u please help why it is returning 0 instead of 37 .
PROCEDURE p_region(chFlag VARCHAR2 DEFAULT 'C',norecords out number,
pc_Region IN OUT pkg_fe_base_dw.rc_datawindow ) IS
BEGIN
-- v_count := 0;
OPEN pc_Region FOR
SELECT rd_dv_cd,
rd_rg_cd,
rd_rg_sdesc,
rd_rg_ldesc,
nvl(ud_user_name,rd_created_by) rd_created_by,
rd_created_dt,
rd_end_dt, chFlag
FROM rtl_region_def a, rtl_user_Def z
WHERE ((chFlag='C' AND rd_end_dt IS NULL) OR (chFlag='H'))
AND a.rd_created_By = z.ud_user_id (+)
AND nvl(ud_most_recent_flag,'Y')='Y'
ORDER BY rd_rg_cd;
norecords := pc_region%rowcount;
--norecords := 1000;
dbms_output.put_line('no of records:-'|| pc_region%rowcount);
--If pc_region%rowcount = 0 then
--dbms_output.PUT_LINE(pc_region%rowcount);
--else
--bms_output.PUT_LINE('No Records to fetch');
--null;
--end if;
END;
END;
/
Thanks in advance.
preethamnorecords := pc_region%rowcount; 14 ariel