Extend with null element to the maximum limit size. : varray « PL SQL « Oracle PL / SQL

Oracle PL / SQL
1.Aggregate Functions
2.Analytical Functions
3.Char Functions
5.Conversion Functions
7.Data Type
8.Date Timezone
9.Hierarchical Query
11.Insert Delete Update
12.Large Objects
13.Numeric Math Functions
14.Object Oriented Database
16.Regular Expressions
17.Report Column Page
18.Result Set
19.Select Query
21.SQL Plus
22.Stored Procedure Function
24.System Packages
25.System Tables Views
27.Table Joins
29.User Previliege
Oracle PL / SQL » PL SQL » varray 
Extend with null element to the maximum limit size.
  2    TYPE number_varray IS VARRAY(5OF INTEGER;
  3    number_list NUMBER_VARRAY := number_varray(1,2,3);
  5    PROCEDURE print_list(list_in NUMBER_VARRAYIS
  6    BEGIN
  7      FOR i IN list_in.FIRST..list_in.COUNT LOOP
  8        DBMS_OUTPUT.PUT_LINE('List Index ['||i||'] '||'List Value ['||list_in(i)||']');
  9      END LOOP;
 10    END print_list;
 11  BEGIN
 12    print_list(number_list);
 14    number_list.EXTEND(number_list.LIMIT - number_list.LAST);
 16    print_list(number_list);
 17  END;
 18  /
List Index [1List Value [1]
List Index [2List Value [2]
List Index [3List Value [3]
List Index [1List Value [1]
List Index [2List Value [2]
List Index [3List Value [3]
List Index [4List Value []
List Index [5List Value []

PL/SQL procedure successfully completed.


Related examples in the same category
1.Varray constructors.
2.legal and illegal varray assignments.
4.Create a varray based on user defined type
5.Store pre-defined constants in VARRAY
6.Creating and Using VARRAYs
7.Query a stored varray.
8.VARRAY of VARCHAR2 and Varray of number
9.Table of numbers and varray of numbers
10.Initialize the array and create two entries using the constructor
11.Reference elements in varray
12.assignments to varray elements, and the ORA-6532 and ORA-6533 errors.
13.ORA-06533: Subscript beyond count
14.Compare two varray variables
15.Constructs a two varrays and one nested table type in the database
16.Control varray index with if statement
17.Create type prices with a varray of number
18.Declare the varray with null values.
19.Declaring a VARRAY of scalar variable
20.Define a varray of integer with 3 rows
21.Define a varray of twelve strings.
22.Define a varray with a null element constructor and extends it one element at a time by a formula
23.Define a varray with a null element constructor and extends it one element at a time.
24.Define a varray with a three element constructor of null elements and attempt to populate it beyond three elements.
25.Define a varray with a three element constructor of null elements.
26.Hard code value in varray and use for loop to insert them to a table
27.Nested varray
28.Reference varray.count in for loop
29.Store 12 months in varray of string
30.Use table() function to display varray type column
31.exceeded maximum VARRAY limit
32.Assign values to subscripted members of the varray.
33.Check the size of a varray
34.Declare an array initialized as a no-element collection.
35.Initialization and assignment with a numeric index value to an associative array.
36.Initialization and assignment with a unique string index value to an associative array.
37.Associative array example
38.Assigns a value to the indexed value.
39.Avoid traversing an associative array where no elements are initialized.
40.Subscript index values begin at 1, not 0
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.