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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Getting not all entry's in table

Re: Getting not all entry's in table

From: Daniel A. Morgan <dmorgan_at_exesolutions.com>
Date: Sat, 24 Feb 2001 15:43:47 -0800
Message-ID: <3A984733.AD184702@exesolutions.com>

You are forgetting to close the cursor. So when you hit your opening method, which is something I would advise never to write as you have, nothing happens.

Write like this in the future

BEGIN
   OPEN CURSOR;
   LOOP    END LOOP;
   CLOSE CURSOR;
EXCEPTION END; And I really don't understand the point of all this code. It seems you have overly complicated it.

Daniel A. Morgan

Rob Zwartjes wrote:

> Hello there,
>
> I have a problem with retrieving all the information in a table running a
> script.
> Here is what I do in short from:
>
> procedure fill_table is
> begin
> insert into my_table values(......);
> commit;
> end fill_table;
>
> procedure check_table is
> cursor c1 is
> select my_name from my_table;
>
> k number(3) := 0;
> name is table of varchar2(30) index by binary_integer;
> begin
> if not c1%isopen then
> open c1;
> end if;
> loop
> fetch c1 into name(k);
> exit when c1%notfound;
> k := k + 1;
> end loop;
> k := k _ 1;
> end check_table;
>
> First procedure fill_table fills my table with some data. At the end I want
> to check table my_table with procedure check_table. The problem now is that
> check_table only returns the new enterd entry's and not the one I made in a
> previous run. I put the command "commit" in it to finish the insert but that
> doesn't help.
> What am I forgetting ????
>
> Thanks in advance,
> Rob
Received on Sat Feb 24 2001 - 17:43:47 CST

Original text of this message

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