Definition:
Stored Procedure is a set of SQL statements for specific functions. It is compiled and stored in the database. You can run a stored procedure by specifying its name and providing parameters (if the stored procedure has parameters. Stored procedures are an important object in databases. Any well-designed database application should use stored procedures. A stored procedure is a process written by flow control and SQL statements. The procedure is compiled and optimized and stored on the database server. You only need to call it when using the application. In Oracle, several associated processes can be combined to form a package.
Advantages:
1. the stored procedure is compiled only when it is created. You do not need to re-compile the stored procedure every time you execute it. Generally, the SQL statement is compiled every time it is executed, therefore, using stored procedures can speed up database execution.
2. when complex operations are performed on databases (for example, when multiple tables are updated, inserted, queried, or deleted ), this complex operation can be encapsulated in a stored procedure and used together with the transaction processing provided by the database.
3. stored procedures can be reused to reduce the workload of database developers.
4. High security. You can set that only a user has the right to use a specified stored procedure.
Comparison between stored procedures and functions
------------------------------------------------------------------------------
Blog: http://blog.csdn.net/tianlesoftware
Online Resources: http://tianlesoftware.download.csdn.net
Video: http://blog.csdn.net/tianlesoftware/archive/2009/11/27/4886500.aspx
Dba1 group: 62697716 (full); dba2 group: 62697977 (full)
Dba3 group: 63306533; chat group: 40132017