What is a stored procedure?
A stored procedure (Procedure) is a set of SQL statements that are compiled to complete a particular function, stored in a database, and executed by specifying the name of the stored procedure and giving parameters.
Stored procedures can contain logical control statements and data manipulation statements, which can accept parameters, output parameters, return single or multiple result sets, and return values. Therefore, we can simply understand that using stored procedures is like running a method in a database.
Advantages of stored Procedures
(1) Faster execution-stored procedures saved in the database SQL statements are compiled
(2) Allow modular programming – reuse of similar methods
(3) Improve system security – prevent SQL injection
(4) Reduce network traffic – only the name of the stored procedure needs to be transferred.
Oracle Stored Procedures