Oracle/PL/SQL

Block Types

Figo Kim 2006. 12. 31. 05:16

Anonymous

Procedure

Function

[DECLARE]

BEGIN

-- statements

[EXCEPTION]

END;

PROCEDURE name

IS

BEGIN

-- statements

[EXCEPTION]

END;

FUNCTION name

RETURN datatype

IS

BEGIN

-- statements

[EXCEPTION]

END;

 

Anonymous : Not stored in the database. To run the same block again, you have to rewrite the same code again.

Subprograms : Stored in the database and declared as either a Procedure or a function.

** A function is similar to a procedure, except that a function must return a value.