Using INDEX BY BINARY_INTEGER : Associative Arrays « Collections « Oracle PL/SQL Tutorial

Oracle PL/SQL Tutorial
1. Introduction
2. Query Select
3. Set
4. Insert Update Delete
5. Sequences
6. Table
7. Table Joins
8. View
9. Index
10. SQL Data Types
11. Character String Functions
12. Aggregate Functions
13. Date Timestamp Functions
14. Numerical Math Functions
15. Conversion Functions
16. Analytical Functions
17. Miscellaneous Functions
18. Regular Expressions Functions
19. Statistical Functions
20. Linear Regression Functions
21. PL SQL Data Types
22. PL SQL Statements
23. PL SQL Operators
24. PL SQL Programming
25. Cursor
26. Collections
27. Function Procedure Packages
28. Trigger
29. SQL PLUS Session Environment
30. System Tables Data Dictionary
31. System Packages
32. Object Oriented
33. XML
34. Large Objects
35. Transaction
36. User Privilege
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Oracle PL/SQL Tutorial » Collections » Associative Arrays 
26. 7. 22. Using INDEX BY BINARY_INTEGER

There is a way of using a FOR loop with the associative arrays INDEX BY BINARY_INTEGER

SQL>
SQL> declare
  2      type dept_rty is record(id number, extra_tx VARCHAR2(2000));
  3      type dept_aa is table of dept_rty index by binary_integer;
  4      v_dept_aa dept_aa;
  5  begin
  6    v_dept_aa(10).id :=10;
  7    v_dept_aa(20).id :=20;
  8
  9    for i in v_dept_aa.first..v_dept_aa.last loop
 10      if v_dept_aa.exists(ithen
 11          DBMS_OUTPUT.put_line(v_dept_aa(i).id);
 12      end if;
 13    end loop;
 14  end;
 15  /
10
20

PL/SQL procedure successfully completed.

SQL>
26. 7. Associative Arrays
26. 7. 1. Associative Arrays demo
26. 7. 2. Associative arrays (index-by tables)
26. 7. 3. PL/SQL Table
26. 7. 4. Index by string
26. 7. 5. Nested Table with Table row elements inside
26. 7. 6. Assign value to PL/SQL table
26. 7. 7. TABLE.Exist
26. 7. 8. Clear the salaries table by assigning the empty version to it
26. 7. 9. Place some values into the salaries table
26. 7. 10. PL/SQL table of cursor
26. 7. 11. Select data into PL/SQL table of cursor
26. 7. 12. Use For loop to output data in a PL/SQL table of cursor
26. 7. 13. Use for all loop to loop through the PL/SQL table
26. 7. 14. Change PL/SQL table element by index
26. 7. 15. Insert data in PL/SQL table to a real table
26. 7. 16. The COUNT Table Attribute
26. 7. 17. Uses the COUNT method to display the number of rows contained in an index-by table
26. 7. 18. The DELETE Table Attribute
26. 7. 19. The EXISTS Table Attribute
26. 7. 20. FIRST and LAST Table Attributes
26. 7. 21. NEXT and PRIOR Table Attributes
26. 7. 22. Using INDEX BY BINARY_INTEGER
26. 7. 23. Indexing Associative Arrays
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.