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

  • Home
  • SEARCH
  • 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 9100015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T00:45:48+00:00 2026-06-17T00:45:48+00:00

I am working on a table structure similar to the below and trying to

  • 0

I am working on a table structure similar to the below and trying to get the output as mentioned.

enter image description here

To acheive this, I written the below PL SQL procedure:

     CREATE OR replace PROCEDURE Sample_procedure
AS
  TYPE list_of_names_t
    IS TABLE OF emp.emp_index%TYPE;
  processedindexes LIST_OF_NAMES_T := List_of_names_t();
  flag             emp.emp_index%TYPE;
  CURSOR c1 IS
    SELECT *
    FROM   emp
    WHERE  Trim(emp_id) = 'AAAAA'
    ORDER  BY last_maint_ts ASC;
BEGIN
    dbms_output.Put('Entered the loop');

    FOR rec IN c1 LOOP
        SELECT emp_index
        INTO   flag
        FROM   emp
        WHERE  emp_id = rec.emp_id
               AND last_maint_ts > rec.last_maint_ts;

        IF flag IS NOT NULL THEN
          processedindexes.extend;

          Processedindexes(processedindexes.last) := flag;

          processedindexes.extend;

          Processedindexes(processedindexes.last) := rec.emp_index;

          dbms_output.Put('The indexes'
                          ||rec.emp_index
                          ||' & '
                          ||flag
                          ||'refer to same emp ID');

          exit;

          dbms_output.Put('received NULL');
        END IF;
    END LOOP;
END;  

1) Everytime, I run this i get the output as Process exited in sql developer, Any suggestion on this?

Note: I am new to PL SQL programming, please correct me if my approach of solving this is not right.

  • 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-06-17T00:45:48+00:00Added an answer on June 17, 2026 at 12:45 am

    open sqlplus and execute the following :-

    set serveroutput on
    exec Sample_procedure;
    

    provided your procedure is compiling fine, it should display the output in dbms_output.put

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

Sidebar

Related Questions

I'm trying to make a PIVOT-query out of a working table with the structure:
Below is a subset of the kind of table structure and data i'm working
while working on osCommerce-3 i got the table structure for category & categories_description as
On the project I am working on, I am stuck with the table structure
I'm working on a publishing tool that has a similar structure to blogs, with
I have a self-referencing table structure working fine with EF, which I use to
I am working with some old table structure html that I am not allowed
Working in a Rails App, I have the following table structure (pertinent columns only)
I got this table structure where we are not allowed to change and i
I am currently working with a MySQL database table structure. I found a table

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.