Understanding nested tables, PL-SQL Programming

Understanding Nested Tables

Within the database, the nested tables can be considered as one-column database tables. The Oracle stores the rows of a nested table in no specific order. But, when you retrieve the nested table into the PL/SQL variable, the rows are given consecutive subscripts starting at 1. That provides you array-like access to the individual rows.

Within PL/SQL, the nested tables are like one-dimensional arrays. Though, nested tables differ from arrays in two significant ways. Firstly, the arrays have a fixed upper bound, but nested tables are unbounded .Therefore, the size of a nested table can increase dynamically.

 

150_Understanding Nested Tables.jpg

                                   Figure: Array versus Nested Table


Secondly, the arrays should be dense (having consecutive subscripts). Therefore, you cannot delete individual elements from an array. Initially, the nested tables are dense, but they can be sparse (having nonconsecutive subscripts). And hence, you can delete elements from a nested table using the built-in procedure DELETE. That might leave gaps in the index, but the built-in function NEXT iterate over any series of subscripts.

Posted Date: 10/3/2012 6:28:57 AM | Location : United States







Related Discussions:- Understanding nested tables, Assignment Help, Ask Question on Understanding nested tables, Get Answer, Expert's Help, Understanding nested tables Discussions

Write discussion on Understanding nested tables
Your posts are moderated
Related Questions
Grouping and Ungrouping in SQL Example specifying EXAM_MARK in place of COURSE in the main FROM clause. Example: Obtaining C_ER2 from EXAM_MARK SELECT CourseId, CAST

Pass the nulls to a dynamic SQL: Passing Nulls: Assume that you want to pass the nulls to a dynamic SQL statement. For illustration, you may write the EXECUTE IMMEDIATE

Project Description: I want somebody who can help me with an idea that I have been working on for a few months now. The person will require extensive knowledge of warcraft 3 PvP

Need Azure CRM Web Application with two-factor authentication We presently have a CRM-like database stored on MS Azure that we presently access over an MS Access application. It

Using Cursor Attributes: Every cursor has 4 attributes: %NOTFOUND, %FOUND, %ISOPEN, and %ROWCOUNT. If appended to the cursor name, they return the helpful information about

Use Serially Reusable Packages To help you to manage the use of memory, the PL/SQL gives the pragma SERIALLY_ REUSABLE that mark some packages as serially reusable . So mark

Question: Consider the following relations (primary keys are underlined): AUTHOR (ANo, aname, address, speciality) PUBLISHER (PNo, pname, Location) BOOK (BNo, Title, ISBN,

Data Types in SQL - XML, Array, Row BINARY LARGE OBJECT for arbitrarily large bit strings. XML for XML documents and fragments. ARRAY types for arrays.

Joining in SQL Joining IS_CALLED and IS_ENROLLED_ON in SQL SELECT * FROM IS_CALLED NATURAL JOIN IS_ENROLLED_ON This is an example of an SQL table expression. I have been

Benefit of the dynamic SQL: This part shows you how to take full benefit of the dynamic SQL and how to keep away from some of the common pitfalls. Passing the Names of Sc