Introduction to Package and Package body in Oracle

Source: Internet
Author: User

1. OracleThe role of Package:

  It can simplify application design, improve application performance, hide information, and overload subprograms.

2. Functions in ORACLE, Package, packageThe differences between bodies and procedure are the same:

  Function has return values, parameters, procedure has no return values, parameters, package, packageThe body exists at the same time, just like. h and. cpp file. If you want to call it externally, declare it in the package. If you want to call it in the package, you only need to write it in the body. Package can include function, procedure

3. In sqlserver, you can directly write a stored procedure and call it. But in oracle, I have read a lot of information saying that to call a stored procedure, you must put the stored procedure into the package before it can be called? Is that true?


No. The process can also be written and called separately.
4. packagesAnd packageWhat is the difference between bodies?
  Only the methods are defined in packages, and specific implementations are involved in bodies. 
5. I wrote a stored procedure in the Stored Procedure procedures. Is it included in the package name? You can still write the package name directly in the package: Just write the stored procedure you want to write directly into the package?
No 
6. Which package should I write? PackagesOr packageBodies 
 The two are integrated and must exist at the same time. 

 PackageBoth the body and package must be manually written.
 You need to create a package (that is, the definition of the package) before creating the body. To add a package or modify the number of input parameters in a package, you must change the package and then the body.

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.