Oracle/PLSQL: CLOSE StatementThe final step of working with cursors is to close the cursor once you have finished using it.
Oracle/PLSQL: CLOSE Statement
Oracle/PLSQL: CLOSE StatementThe basic syntax to CLOSE the cursor is:
Oracle/PLSQL: CLOSE Statement
Oracle/PLSQL: CLOSE StatementCLOSE cursor_name;
Oracle/PLSQL: CLOSE Statement
Oracle/PLSQL: CLOSE Statement
Oracle/PLSQL: CLOSE Statement
Oracle/PLSQL: CLOSE StatementFor example, you could close a cursor called c1 with the following command:
Oracle/PLSQL: CLOSE Statement
Oracle/PLSQL: CLOSE StatementCLOSE c1;
Oracle/PLSQL: CLOSE Statement
Oracle/PLSQL: CLOSE Statement
Oracle/PLSQL: CLOSE Statement
Oracle/PLSQL: CLOSE StatementBelow is a function that demonstrates how to use the CLOSE statement:
Oracle/PLSQL: CLOSE Statement
Oracle/PLSQL: CLOSE StatementCREATE OR REPLACE Function FindCourse
Oracle/PLSQL: CLOSE Statement   ( name_in IN varchar2 )
Oracle/PLSQL: CLOSE Statement   RETURN number
Oracle/PLSQL: CLOSE StatementIS
Oracle/PLSQL: CLOSE Statement    cnumber number;
Oracle/PLSQL: CLOSE Statement
Oracle/PLSQL: CLOSE Statement    CURSOR c1
Oracle/PLSQL: CLOSE Statement    IS
Oracle/PLSQL: CLOSE Statement       SELECT course_number
Oracle/PLSQL: CLOSE Statement        from courses_tbl
Oracle/PLSQL: CLOSE Statement        where course_name = name_in;
Oracle/PLSQL: CLOSE Statement
Oracle/PLSQL: CLOSE StatementBEGIN
Oracle/PLSQL: CLOSE Statement
Oracle/PLSQL: CLOSE Statementopen c1;
Oracle/PLSQL: CLOSE Statementfetch c1 into cnumber;
Oracle/PLSQL: CLOSE Statement
Oracle/PLSQL: CLOSE Statementif c1%notfound then
Oracle/PLSQL: CLOSE Statement     cnumber := 9999;
Oracle/PLSQL: CLOSE Statementend if;
Oracle/PLSQL: CLOSE Statement
Oracle/PLSQL: CLOSE Statementclose c1;
Oracle/PLSQL: CLOSE Statement
Oracle/PLSQL: CLOSE StatementRETURN cnumber;
Oracle/PLSQL: CLOSE Statement
Oracle/PLSQL: CLOSE StatementEND;
Oracle/PLSQL: CLOSE Statement

相关文章: