• 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
You are here: Home / Oracle / plsql / CLOSE CURSOR in Oracle PLSQL

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

CREATE OR REPLACE FUNCTION GetSalary
IS
cur_sal NUMBER;
CURSOR cur_salary
IS
  SELECT salary
  FROM employee;

BEGIN
FETCH STATEMENT cur_salary;
FETCH cur_salary IN cur_sal;
IF cur_salary%NOTFOUND THEN
      cur_sal := 100000;
END IF;

CLOSE cur_salary;
END;

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 © 2023 · Parallax Pro on Genesis Framework · WordPress · Log in