Definition:
DECLARE is an optional sectional of a PL/SQL block. It is used for the declaration of local memory variables, localized subprograms (procedures or functions) to be used within the PL/SQL block. The scope and visibility of the variables within the DECLARE section is limited only to that anonymous block.
The DECLARE keyword is not required in PL/SQL subprograms (procedures and functions). The section contained within IS and BEGIN is known as the Declarative section. Note that TRIGGER requires the DECLARE section to be declared explicitly.
Example Syntax
Anonymous PL/SQL block
DECLARE
L_SUM NUMBER;
BEGIN
L_SUM := 10 + 20;
END;
Subprograms
CREATE OR REPLACE PROCEDURE P_SUM
IS
L_SUM NUMBER;
BEGIN
L_SUM := 10 + 20;
END;