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 -> Accessing a complete collection

Accessing a complete collection

From: Paul Q <paulq_at_home.com>
Date: Mon, 18 Jun 2001 02:56:58 GMT
Message-ID: <_5eX6.147862$Be4.45245145@news3.rdc1.on.home.com>

"So I defined a table in memory to be like a database table structure."

TYPE SomeTyp IS TABLE OF database_table%ROWTYPE

      INDEX BY BINARY_INTEGER; Some_tab SomeTyp;



" And I can add records into the memory table easily enough "

ind := 0
 open my_cursor (seq,ordinal,v_element_list(z), state);

    loop
    fetch my_cursor into Some_tab(ind+1);

     exit when my_cursor%notfound;
     ind := ind +1;

    end loop;
    close my_cursor;
"And I can see that the data is being stored in the memory table"

for z in 1 .. IND
  loop
   dbms_output.put_line(to_char(z)||' '||

      Some_tab(z).name||' '||
      Some_tab(z).condition||' '||
      Some_tab(z).state
     );

   end loop;

Finally The Question...
 Is there a method of accessing only certain elements of the memory table without accessing each individual row..

 ie... a cursor that will

    select * from memory_table
    where condition

" instead of "

   for z in 1 .. element_counter
    loop

      for t in element_counter+1  .. Some_tab.count
       loop
        if Some_tab(t).element_order = z then
       dbms_output.put_line(Some_tab(t).name);
        end if;
     end loop;

   end loop; Received on Sun Jun 17 2001 - 21:56:58 CDT

Original text of this message

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