PL/SQL %TYPE Attribute

The %TYPE attribute allow you to declare a constant, variable, or parameter to be of the same data type as previously declared variable, record, nested table, or database column.

Syntax:

identifier Table.column_name%TYPE;

Example:

declare
v_name employee.lastname%TYPE;
v_dep  number;
v_min_dep v_dep%TYPE:=31;
begin
select lastname into v_name from EMPLOYEE where DEPARTMENTID=v_min_dep;
DBMS_OUTPUT.PUT_LINE('v_name: '||v_name);
end;