Blocks are typically written as part of a procedure, function, subprogram, or trigger. Procedure, function, and trigger programs are named and stored in the database for reuse. For quick (one-time) execution (such as testing), you can enter the block without providing a name or storing it in the database.
A block of this type is called an anonymous block. An anonymous block is unnamed and is not stored in the database. After the block has been executed and erased from the application buffer, it cannot be re-executed unless the block code is re-entered into the application.
Typically, the same block of code will be re-executed many times. To run a block of code repeatedly without the necessity of re-entering the code each time, you can turn an anonymous block into a procedure or function by making some simple modifications. The following topics discuss how to create a procedure or function that can be stored in the database and invoked repeatedly by another procedure, function, or application program.