Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> select inside a cursor problem

select inside a cursor problem

From: Mark Bathie <markbathie_at_go.com>
Date: 13 May 2003 22:46:55 -0700
Message-ID: <e55d17df.0305132146.3c59e7e4@posting.google.com>


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;
  end loop;
END; It should be calling the write_log procedure 40,000 times, but stops at 350 !

Cheers,

Mark. Received on Wed May 14 2003 - 00:46:55 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US