Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> select inside a cursor problem
Hi,
I am trying to execute some PL/SQL. The basic idea is I have a cursor and wish to iterate through each row using a for loop. Within that loop I'm simply selecting a value from another table using "select into". The problem is that it should be returning 40,000odd rows, instead it stops at 350. I just can figure out why is stops way short of 40,000. Any ideas.
create or replace procedure TEST
is
v_id people.id%TYPE;
cursor c_select is
select *
from vw v
where emplid > 34400000
order by emplid;
v_id_cnt integer;
v_rowcnt integer := 0;
BEGIN
for i in c_select loop
v_id_cnt := 0;
select count(*) into v_id_cnt from people where uqid=i.emplid;
if v_id_cnt = 1 then
select id into v_id from people where uqid=i.emplid write_log('TESTING',v_id||' - '||v_id_cnt);end if;
Cheers,
Mark. Received on Wed May 14 2003 - 00:46:55 CDT