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 6535029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:19:23+00:00 2026-05-25T10:19:23+00:00

I have a fairly time intensive PL/SQL block that builds fingerprints from molecular structures.

  • 0

I have a fairly time intensive PL/SQL block that builds fingerprints from molecular structures. I would like to print output to SQL*Plus console to provide feedback on how many structures have been processed. I can do this with dbms_output.put_line

However everytime that is called a new line is written. I want to overwrite the line.

For example, currently I have the below.

Structure x of y processed
Structure x of y processed
Structure x of y processed
Structure x of y processed

Eventually I fill up the buffer as I’m dealing with thousands of structure records.

Is there a method I can use that will just overwrite the last output line?

  • 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-25T10:19:23+00:00Added an answer on May 25, 2026 at 10:19 am

    Using DBMS_OUTPUT means that SQL*Plus will display nothing until the entire PL/SQL block is complete and will then display all the data currently in the buffer. It is not, therefore, an appropriate way to provide an ongoing status.

    On the other hand, Oracle does provide a package DBMS_APPLICATION_INFO that is specifically designed to help you monitor your running code. For example, you could do something like

    CREATE PROCEDURE process_structures
    AS
      <<other variable declarations>>
    
      rindex    BINARY_INTEGER;
      slno      BINARY_INTEGER;
      totalwork NUMBER := y; -- Total number of structures
      worksofar NUMBER := 0; -- Number of structures processed
    BEGIN
      rindex := dbms_application_info.set_session_longops_nohint;
    
      FOR i IN (<<select structures to process>>)
      LOOP
        worksofar := worksofar + 1;
        dbms_application_info.set_session_longops(
            rindex      => rindex, 
            slno        => slno,
            op_name     => 'Processing of Molecular Structures', 
            sofar       => worksofar , 
            totalwork   => totalwork, 
            target_desc => 'Some description',
            units       => 'structures');
        <<process your structure with your existing code>>
      END LOOP;
    END;
    

    From a separate SQL*Plus session, you can then monitory progress by querying the V$SESSION_LONGOPS view

    SELECT opname,
           target_desc,
           sofar,
           totalwork,
           units,
           elapsed_seconds,
           time_remaining
      FROM v$session_longops
     WHERE opname = 'Processing of Molecular Structures';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a fairly complex multi threaded application (server) that from time to time
I have a series of 'tasks' that I would like to run in separate
I have a fairly process intensive method that takes a given collection, copies the
I have a fairly simple query that runs super fast most of the time
I have a website that is fairly database intensive, so I'm trying to cut
I have a fairly simple web application that gets a list of items from
We have a fairly graphical intensive application that uses the FOX toolkit and OpenSceneGraph,
Our users have created MS-Excel spreadsheets which over time have evolved into fairly complex
I have a fairly small MySQL database (a Textpattern install) on a server that
I have a fairly standards compliant XHTML+CSS site that looks great on all browsers

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.