• Skip to primary navigation
  • Skip to main content

Tech Honey

The #1 Website for Oracle PL/SQL, OA Framework and HTML

  • Home
  • HTML
    • Tags in HTML
    • HTML Attributes
  • OA Framework
    • Item in OAF
    • Regions in OAF
    • General OAF Topics
  • Oracle
    • statement
    • function
    • clause
    • plsql
    • sql

using CLOSE CURSOR in oracle database query

CLOSE CURSOR in Oracle PLSQL

December 1, 2012 by techhoneyadmin

The CLOSE CURSOR in Oracle PLSQL is used when we have finished processing the records of the CURSOR.

Syntax to use CLOSE CURSOR in Oracle SQL / PLSQL is:

CLOSE cursor_name;

Let’s understand, how to CLOSE CURSOR from the help of the below Oracle PLSQL function

view source
print?
1CREATE OR REPLACE FUNCTION GetSalary
2IS
3cur_sal NUMBER;
4CURSOR cur_salary
5IS
6  SELECT salary
7  FROM employee;
8 
9BEGIN
10FETCH STATEMENT cur_salary;
11FETCH cur_salary IN cur_sal;
12IF cur_salary%NOTFOUND THEN
13      cur_sal := 100000;
14END IF;
15 
16CLOSE cur_salary;
17END;

The statement CLOSE cur_salary; will be used to close the cursor cur_salary.

Filed Under: plsql Tagged With: CLOSE CURSOR in oracle plsql, CLOSE CURSOR in oracle sql, CloseCursorPLSQL, CURSORPLSQL, how to CLOSE CURSOR in oracle database query, how to CLOSE CURSOR in oracle plsql, how to CLOSE CURSOR in oracle sql, syntax and example of CLOSE CURSOR in oracle database query, syntax and example of CLOSE CURSOR in oracle plsql, syntax and example of CLOSE CURSOR in oracle sql, using CLOSE CURSOR in oracle database query, using CLOSE CURSOR in oracle plsql, using CLOSE CURSOR in oracle sql

Copyright © 2025 · Parallax Pro on Genesis Framework · WordPress · Log in