- 액세스시 색인/첨자(키 값)이 필요
- 장점
1) simplify the code
2) loop through each element with ease by using collection built-in methods
3) improved performance - cache static data
* Associative arrays (index-by tables)
: let you look up elements using arbitrary numbers and strings for subscript values.
hash tables in other programming languages.
- sets of (unique index key, value) pairs
1) 상대적으로 작은 룩업 테이블에 적합 <== 메모리에 생성되므로
2) 크기를 미리 알 수 없는 집합 데이터에 적합 <== 크기 제한 없으므로
3) 색인값이 유연(flexible) <== 색인값: 음수, 양수, 문자열 가능하고 nonsequential도 가능하므로
* Nested tables
1) hold an arbitrary number of elements.
2) use sequential numbers as subscripts.
3) can be sparse
4) 데이터베이스 테이블에 저장 가능
* Varrays (short for variable-size arrays)
1) hold a fixed number of elements ==> 개수를 미리 알고 있을시 적합
2) the number of elements can be changed at runtime.
3) use sequential numbers as subscripts.
4) 데이터베이스 테이블에 저장 가능
* Choosing Which PL/SQL Collection Types to Use (When to use What?)
==> http://goo.gl/0dDcf
- Varray
. Use to preserve ordered list
. Use when working with a fixed set, with a known number of entries
. Use when you need to store in the database and operate on the Collection as a whole
- Nested Table
. Use when working with an unbounded list that needs to increase dynamically
. Use when you need to store in the database and operate on elements individually
- Associative Array
. Use when there is no need to store the Collection in the database
. Its speed and indexing flexibility make it ideal for internal application use
'Oracle > PL/SQL' 카테고리의 다른 글
15일차 # 6-26: 추가 BULK COLLECT (0) | 2012.04.24 |
---|---|
15일차 # 6-20: Using Collection Methods (0) | 2012.04.24 |
15일차 # 6-14: Update with records (0) | 2012.04.24 |
15일차 # 6-13: Insert with records (0) | 2012.04.24 |
15일차 # 6-9: %ROWTYPE attribute (0) | 2012.04.24 |