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

Term: ROWTYPE

Definition:
In Oracle PL/SQL, a PL/SQL record can be declared using the ROWTYPE specifier, which can be thought of as being analogous to a row in the database table. A record declared using TABLE%ROWTYPE carries the same structure, including names and data type as that of a logical record of the table. Note that the attributes do not inherit the constraints on the columns of the database table.

ROWTYPE can also be used with explicit cursors to declare Cursor Variables.

Example Syntax:

[RECORD NAME]  TABLE%ROWTYPE


Example Usage:

The Pl/SQL block below declares a record "L_REC" which includes all columns of the EMPLOYEE table as attributes. It can contain a row from the EMPLOYEE table.

DECLARE
L_REC EMPLOYEE%ROWTYPE;
CURSOR C1
IS
SELECT *
FROM EMPLOYEE
WHERE EMPNO = 100;
BEGIN
OPEN C1;
FETCH C1 INTO L_REC;
CLOSE C1;
END;



Related Links:

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