COLLECTIONS

1-WHAT IS DIFF BETWEEN VARRAY AND TABLE?
2-WHAT IS SQL SUPPORT FOR NESTED TABLE?
3-WHAT IS INLINE STORAGE AND OUT OF LINE STOGARE OF THE NESTED TABLE?
4-WHAT ARE COMMON EXCEPTION RELATED WITH COLLECTION?
5-CAN U DECLARE VARRAY OF VARRAY OF VARRAY OF TABLE?
6-GIVE SAMPLE DEFINATION OF VARRAY OF OBJECT AND TABLE OF OBJECT?
7-WHAT ARE COMMON METHODS OF HANDLING EXCEPTIONS?

Questions by sdas84jobs

Showing Answers 1 - 12 of 12 Answers

Main diff between nested table and varray are..
1. Varrays have maximum size but nested table do not have maximum size
2.
Nested tables always dense, but varrays sparse. Elements of nested table can be deleted but varrays cant be deleted.
3.
Varrays stored in database in same table space but nested table data store out of database line in
separate table space.
4. Varrays data in database store as unique consecutive
subscripts but nested table not.

diff between nested table and varrays.

1.varrays will have max size but nested table do not have.

2.varrays stored in database in same table space but nested table in diff table space.

3.varrays are always dense but nested table can be sparse . we cant delete indisual elments of varrays.

4.varrays stored in database maintain there ordering and subscripts.

  Was this answer useful?  Yes

Collections similarities and differences

Collection Type Elements Limit Subscript Type Uninitialized Status Always Dense
-----------------------------------------------------------------------------------------------------------------------------------
Associative array Unlimited String or Integer Empty NO
Nested table Unlimited Integer NULL NO
VARRAY Fixed Integer NULL YES

Defining and Declaring Collections

Code
  1. -- Associative Array (index by integer)

  2.  



  3. v_sno sno_at;

  4.  

  5. -- Associative Array (index by string)

  6.  

  7. TYPE marks_at IS TABLE OF NUMBER


  8. v_marks marks_at;

  9.  

  10. -- Nested Table

  11.  

  12. TYPE fruits_nt IS TABLE OF VARCHAR2;

  13. v_fruits fruits_nt;

  14.  

  15. --VARRAY

  16.  

  17. TYPE fruits_vt IS VARRAY(10) OF


  18. v_fruits fruits_vt;

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions