Declaring PL/SQL Variables
What this topic covers
Choose valid identifiers, declare and initialize variables, and use bind variables in PL/SQL. Select suitable data types, including %TYPE and %ROWTYPE to anchor declarations to database columns or rows.
What does employees.salary%TYPE do in a variable declaration?
It declares the variable with the same data type as the salary column, so the declaration follows the column. If the column changes to a compatible type, the variable picks up that change without editing the block. Use %TYPE when the value comes from a table column.