STATIC CURSOR

This is the logical area in which dynamic updations not possible. If we want those updations in logical area we close the cursor and we need to reopen it.

Example: DECLARE SC CURSOR STATIC FOR SELECT * FROM DEPT

OPEN SC

FETCH FIRST FORM SC

10 SALES LONDON

UPDATE DEPT SET DEPTNO=15 WHERE DEPTNO=10

FETCH FIRST FROM SC

10 SALES LONDON

FETCH ABSOLUTE -2 FROM SC

30 IR BAN

FETCH FIRST FROM SC

15 SALES LONDON

FETCH RELATIVE 2 FROM SC

30 IR BAN

FETCH RELATIVE -2 FROM SC

15 SALES LONDON

CLOSE SC

DEALLOCATE SC
Share/Bookmark

No comments: