Oracle/PL/SQL
15일차 # 7 - Explicit Cursors
Bohemian life
2012. 4. 24. 21:37
# Cursor
- a kind of pointer to the private SQL area created in memory by server
- the private SQL area stores the information on processing SQL statement
* implicit cursor (by PL/SQL) --> 커서 선언 불필요
- SQL cursor
- implicit cursor for loop or cursor for loop using subquery
* explicit cursor (by programmer) --> 선언부에서 커서 변수 선언
- cursor
- cursor with parameters --> 파라미터 값에 따라 active set의 내용이 달라짐
- cursor for loop
- cursor for loop with parameters --> 파라미터 값에 따라 active set의 내용이 달라짐
- for update cursor --> update 또는 delete 문의 current of 절
* Cursor For Loop: 둘 이상의 결과를 갖는 SQL 문을 간편하게 처리하는데 유용
- 커서 레코드 자동 선언
- 커서 제어(OPEN, FETCH, CLOSE) 자동 처리
# Active Set
- 커서의 SQL 문(보통 select 문)이 실행된 결과 행의 집합