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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:48:51+00:00 2026-05-24T17:48:51+00:00

For Nested table i have done it in follwing way? This is pl/sql stored

  • 0

For Nested table i have done it in follwing way?
This is pl/sql stored procedure.

CREATE or REPLACE PROCEDURE TEST(
activationStartDate IN DATE,
activationEndDate IN DATE,
deActivationStartDate IN DATE,
deActivationEndDate IN DATE
Out_Entity OUT TEST1.RefCsr
)
AS
FirstNameListTable LIST_TABLE;

{--COMMENT :LIST_TABLE is nested table :create or replace TYPE "LIST_TABLE" as table     of varchar2(20);-----Nested Table Declaration
/
}

 totalSameFirstName NUMBER;
 j NUMBER := 1;
 BEGIN



 SELECT first_name BULK COLLECT INTO FirstNameListTable FROM Employee where start_date between activationStartDate AND activationEndDate 
MINUS 
SELECT first_name FROM Employee where start_date between deActivationStartDate AND deActivationEndDate

OPEN Out_Entity FOR SELECT * FROM TABLE(
                                           CAST (
                                                FirstNameListTable AS LIST_TABLE
                                             )
                                ) Nos;

  END;
   /

My JavaCode is

--First getConnection
--prepare sql string : sql = "{ Call Test(?,?,?,?,?) } ";
--Use prepareCall function on Connection object and passed this sql string and retrived CallableStatement class object.
stmt.setTimestamp(1,activationStartDate);
stmt.setTimestamp(2,activationEndDate);
stmt.setTimestamp(3,deActivationStartDate);
stmt.setTimestamp(4,deActivationEndDate);
stmt.registerOutParameter(5,-10);
stmt.execute();
List result = new ArrayList();
         ResultSet rs = (ResultSet)stmt.getObject(5);
        int i=0;
        while (rs.next()) 
        {
            System.out.println(i+". "+rs.getString(1));
            i++;
        }

Then what if i want to select more than one column from EMPLOYEE and pass to my javaCode……How my javaCode and Pl/Sql will look like?

  • 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-24T17:48:52+00:00Added an answer on May 24, 2026 at 5:48 pm

    you need to use nest loop

    for example in the result set get the column count value

    and try like this

    List<List> result = new ArrayList()<List>;
    List col = new ArrayList();
    
    ResultSet rs = (ResultSet)stmt.getObject(5);
    ResultSetMetaData rsMetaData = rs.getMetaData();
    
            int numberOfColumns = rsMetaData.getColumnCount();
            while (rs.next()) 
            {
                col = new ArrayList();
                for(int j=1;j<numberOfColumns;j++)
                    col.add(rs.getString(j);
    
                result.add(col);
            }
    

    here first loop for getting the rows and the nested loop to getting the columns value
    this value are store in the col list object and need to each time create new object

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

Sidebar

Related Questions

I have created this type: create or replace type PRODTABLE as table of PROD_OBJ;
I have nested table xxx_nested_table in Oracle CREATE OR REPLACE TYPE xxx_tab AS TABLE
Querying a Nested Set Model table , here's the SQL... how can this be
Say I have 2 objects MY_OBJ, MY_NESTED_TABLE_OBJ CREATE OR REPLACE TYPE MY_NESTED_TABLE_OBJ IS TABLE
We have a sql query as follows select * from Table where date <
I have this nested table structure. Is it possible to merge 111 and 222
I have a table with some nested tables ( this is outputted but a
I currently have a table with a nested table in it: <table class=datagrid id=report>
How would I create a nested grouping for the table below, using LINQ? I
I have an html table nested in an html table cell. I want the

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.