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 -> Re: How to reset a pl/sql-collection ?

Re: How to reset a pl/sql-collection ?

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 23 Sep 2005 06:29:27 -0700
Message-ID: <1127482167.912892.123630@g14g2000cwa.googlegroups.com>


Instead of using delete which works on a entry by entry basis define two occurrences of the arrary structure. Only use the one and when you are ready to reuse it set it equal to the unused one.

type t_atsr is table of r_ats
  index by binary_integer ;

t_ats       t_atsr          ;  -- alloc plsql tbl 4 new tblspc data
t_empty   t_atsr          ;  -- empty tbl 2 allow freeing mem during
testing

later in code
t_ats := t_empty ;
dbms_session.free_unused_user_memory ;

For your use you would not do the dbms_session.free_unused_user_memory until you were about to exit the routine either normally or due to a serious error but you would want to reset it right before you repopulate it in your logic.

HTH -- Mark D Powell -- Received on Fri Sep 23 2005 - 08:29:27 CDT

Original text of this message

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