Quick Search:
CODE
Oracle PL/SQL Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
 The Oracle PL/SQL OPEN Keyword      [Return To Index] Jump to:  
  Looking for the original pages? (formerly called "Morgan's Library") You can find them here.

Term: OPEN

Definition:
In Oracle PL/SLQ, OPEN is the first stage of a Cursor Execution Cycle, where Oracle executes the SQL query associated with the cursor and returns the result set into the context area. This is an overview of the steps which take place in the OPEN stage:

  1. A portion of memory is dynamically allocated for context area
  2. The SELECT query is parsed, bound, and executed to fetch the result set
  3. The cursor now points the first row in the active set

Example Syntax:

OPEN [CURSOR NAME];
FETCH [CURSOR NAME] INTO [LIST OF MEMORY VARIABLES];
CLOSE [CURSOR NAME]


Example Usage:

DECLARE
CURSOR C IS
SELECT ENAME, DEPTNO
FROM EMPLOYEE
WHERE EMPNO=100;
L_ENAME VARCHAR2(100);
L_DEPTNO NUMBER;
BEGIN
OPEN C;
FETCH C INTO L_ENAME, L_DEPTNO;
CLOSE C;
END;



Related Links:
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 59 users online    © 2009 psoug.org
PSOUG LOGIN
Username: 
Password: 
Forgot your password?