Thursday, November 13, 2008

%TYPE and %ROWTYPE in PL/SQL

The %TYPE attribute provides the datatype of a variable or database column. This is
particularly useful when declaring variables that will hold database values.

v_last_name employees.last_name%TYPE;

In PL/SQL, records are used to group data. A record consists of a number of related
fields in which data values can be stored. The %ROWTYPE attribute provides a record
type that represents a row in a table.

dept_rec departments%ROWTYPE;

No comments:

search engine

Custom Search