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
Forward Declarations The PL/SQL needs that you declare an identifier before using it. And hence, you should declare a subprogram before calling it. For illustration, the decla

SQL Pseudocolumns The PL/SQL recognizes the following SQL pseudocolumns, that returns the specific data items: LEVEL, NEXTVAL, CURRVAL, ROWID, & ROWNUM. The Pseudocolumns are n

Closest Approximation to Relational Union - SQL Actually, just as SQL has several varieties of JOIN, it also has several varieties of UNION, none of which is equivalent to th

SQL outer join SELECT * FROM IS_CALLED NATURAL LEFT JOIN IS_ENROLLED_ON Note that adding LEFT to an invocation of CROSS JOIN has no effect unless the right-hand operand

Selecting Objects: Suppose that you have run the SQL*Plus script below that creates object type Person and object table persons, and that you have settled the table: CREATE

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

EXECUTE Privilege To call an invoker-rights routine straightforwardly, the users should have the EXECUTE privilege on that routine. By yielding the privilege, you permit a user

Use of COUNT in SQL It describes and discusses various general methods of expressing constraints, eventually noting that support for "=" with relation operands is sufficient f

I need SQL , WP SQL Expert Project Description: Expert required to modify WP SQL query. Skills required are MySQL, SQL, PHP, Wordpress

Assigning and Comparing Collections One collection can be assigned to other by an SELECT, INSERT, UPDATE, or FETCH statement, an assignment statement, or by a subprogram call. A