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
"Not Enforced" Table Constraints A constraint that is not enforced is not really a constraint within the meaning of the act, but SQL does have such a concept and it needs to b

IN Operator The operator IN tests the set membership. This means "equal to any member of." The set may have nulls, but they are ignored. For illustration, the statement below do

Oracle 11 G new features associated with this release:- Enhanced ILM  - Information Lifecycle Management (ILM) has been around for the almost 10 years, but Oracle has made

Using Operator VALUE: As you may expect, the operator VALUE returns the value of an object. The VALUE takes its argument a correlation variable.  For illustration, to return a

%TYPE Attribute The %TYPE attribute gives the datatype of a record, field, nested table, database column, or the variable. You can use the %TYPE attribute as the datatype speci

Advantages of Invoker Rights The Invoker-rights routines centralize the data retrieval. They are particularly helpful in applications which store data in various schemas. In su

Using a join on 3 tables, select 5 columns and 10 rows from the 3 tables without the use of a Cartesian product Query: SELECT E.LAST_NAME, E.FIRST_NAME, S.BUILDING, S.BRAN

Parameter Default Values As the illustration below shows, you can initialize the IN parameters to the default values. In that way, you can pass various numbers of actual par

Declaring a Cursor The Forward references are not allowed in the PL/SQL. Therefore, you must declare a cursor before referencing it in other statements. Whenever you declare a

Initializing Objects: Till you initialize an object by calling the constructor for its object type, the object is automatically null. That is, the object itself is null, not me