Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3983334
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:38:07+00:00 2026-05-20T05:38:07+00:00

I have a collection of sysid’s that I am using to iterate over in

  • 0

I have a collection of sysid’s that I am using to iterate over in several forall loops. This script is meant to be run on a regular basis, so I would like to know whether the collection persists in the database and needs to be cleared out, or if the script is alright as-is.

Also, I am new to PL/SQL, so if you see anything wrong with the script, please do let me know.

This is going to run on Oracle 10g and 11g.

Thanks

DECLARE

TYPE sSysid IS TABLE OF person.sysid%TYPE
    INDEX BY PLS_INTEGER;

l_sSysid sSysid;

BEGIN
    SELECT sysid
    BULK COLLECT INTO l_sSysid
        FROM person
        where purge_in_process = 1;

FORALL i IN l_sSysid.FIRST .. l_sSysid.LAST
    delete from person_attribute where property_pk like concat(l_sSysid(i), '%');

FORALL i IN l_sSysid.FIRST .. l_sSysid.LAST
    delete from person_property where person_sysid = l_sSysid(i);

FORALL i IN l_sSysid.FIRST .. l_sSysid.LAST
    delete from person where sysid = l_sSysid(i);


END;
/
commit;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T05:38:08+00:00Added an answer on May 20, 2026 at 5:38 am

    The collection is a local variable so it will no longer exist after the block finishes executing. There will be no need to clear it out. Depending on the number of rows in the PERSON table where PURGE_IN_PROCESS will be 1, you may want to use the LIMIT clause in order to avoid consuming too much PGA memory though.

    The idea of an anonymous PL/SQL block that is run regularly, however, is a bit foreign to me. If you intend the code to be run regularly, I’d strongly suggest that you create a stored procedure rather than an anonymous block and then schedule the procedure to be run regularly. That opens up the ability to use the database’s scheduling facilities (DBMS_JOB and DBMS_SCHEDULER) to run the process and allows other applications to call it as well if the need ever arises. Plus, you’ll get the benefits of things like dependency tracking in the database.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have collection of object as Collection basics = periodic.getGeneratedBasic(); When iterate over this
Let's say I have collection with 100 elements. Regular enumerator would iterate over those
I have Collection List<Car> . How to compare each item from this collection with
for example I have collection foo of documents like that: {tag_cloud:[{value:games, count:10}, {value:girls, count:500}]}
I have a collection that use as a cache. How can I limit the
I have a collection of Objective-C classes that get sub-classed at a variety of
I have collection with events, indexed by time field. Can i run more then
I have collection of div tags in the form tag, like this: <form ...>
I have collection of products from web service, I preview this product in Grid
I have collection of patient in a lists named lst_Patient. And this is method

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.