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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:58:37+00:00 2026-05-27T16:58:37+00:00

I have a table Students with the following schema: CREATE TABLE STUDENTS ( SID

  • 0

I have a table Students with the following schema:

CREATE TABLE STUDENTS
(
    SID    VARCHAR2(10 BYTE)    NOT NULL,
    SNAME  VARCHAR2(50 BYTE)    NOT NULL, . . .
)

I want to create a stored procedure that will take a list of students as input argument each item in the list will have sid and sname.

What will be the type of the input parameter and how to define it?

  • 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-27T16:58:38+00:00Added an answer on May 27, 2026 at 4:58 pm

    You could pass in an Oracle collection type as a parameter.

    The collection could be a key value pair such as an associative array indexed by a varchar.
    In that example, the index could be the SID and the value could be the SNAME.

    Read here to learn about collections: http://docs.oracle.com/cd/B10501_01/appdev.920/a96624/05_colls.htm

    And here for associative arrays in particular: http://www.oracle-base.com/articles/9i/AssociativeArrays9i.php

    Alternatively you could pass two parameters, both collections holding varchar values (such as DBMS_SQL.VARCHAR2_TABLE types) the first holding the SID and the second holding the corresponding SNAME values they would effectively be linked by their index number.
    See here for DBMS_SQL defined types: http://docs.oracle.com/cd/B19306_01/appdev.102/b14258/d_sql.htm

    Hope it helps…

    EDIT:

    If you are declaring all types and performing all actions within a package then:

    -- Declare type
    TYPE student_coltype IS TABLE OF student%ROWTYPE
         INDEX BY BINARY_INTEGER;
    -- Declare variable of type
    student_col student_coltype;
    

    If you want global types then you’ll have to explicitly declare the columns:

    CREATE TYPE student_rec
    AS OBJECT 
    (SID   VARCHAR2(10),
     SNAME VARCHAR2(50));
    
    CREATE TYPE student_collection
    AS TABLE OF student_rec;
    

    You can then use the student collection type with your DB to pass collections of student data into and out of procedures and functions.

    The docs for using oracle objects are here: http://docs.oracle.com/cd/B19306_01/appdev.102/b14260/adobjint.htm

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

Sidebar

Related Questions

I have the following table and I want to retrieve students ( STUD_ID )
I have the following scenario in zend framework: Data Table of students Table of
I have reduced a complex schema to the following samples Students StudentID int, Name
i have the following table Students: id | status | school | name ----------------------------
I have a table (session_comments) with the following fields structure: student_id (foreign key to
I have a table that looks like this for about ~30 students: StudentID Course*
Let's say I have a table that represents a super class, students . And
So I have two tables students (PK sID) and mentors (PK pID). This query
I have a table that looks something like this: CREATE TABLE student_results(id integer, name
I have a table student(id, name, department, age, score). I want to find 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.