Oracle stored procedure definitions and benefits and differences from functions

Source: Internet
Author: User

Defined:

A stored procedure (Stored Procedure) is a set of SQL statements that are compiled and stored in a database in order to accomplish a specific function. The user executes it by specifying the name of the stored procedure and giving the parameter (if the stored procedure has parameters). Stored procedures are an important object in a database, and any well-designed database application should use stored procedures. A stored procedure is a process written by flow control and SQL statements that are compiled and optimized to be stored in the database server as long as the application is invoked. In Oracle, several linked processes can be grouped together to form a package.


Advantages:

1. ( precompiled ) stored procedures are compiled only at creation time, and each subsequent execution of the stored procedure does not need to be recompiled, and the general SQL statements are compiled once per execution, so using stored procedures increases the speed of the database execution.

2. ( transactional ) when complex operations are performed on a database, such as when you update, Insert, Query, and delete multiple tables, this complex operation can be encapsulated with stored procedures and used in conjunction with the transactional processing provided by the database.

3. ( repetitive ) stored procedures can be reused to reduce the workload of database developers.

4. ( security ) high security, can be set only one user has the right to use the specified stored procedures.

comparison of stored procedures and functions

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.