Oracle SQL,PL/SQL

Anonymous PL/SQL Block

Written by shohal

Anonymous PL/SQL Block Structure:

[DECLARE]

BEGIN

–statements

[EXCEPTION]

END;

Example:

set serveroutput on
VARIABLE X NUMBER;
BEGIN
:X:=11;
DBMS_OUTPUT.PUT_LINE(:X);
END;
/


DECLARE
X NUMBER:=1;
BEGIN
DBMS_OUTPUT.PUT_LINE(X);
END;
/

About the author

shohal

Leave a Comment