Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people's questions, and connect with other people.

Have an account? Sign In

Captcha Click on image to update the captcha.

Have an account? Sign In Now

Sign In

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Sorry, you do not have a permission to ask a question, You must login to ask question.

Forgot Password?

Need An Account, Sign Up Here
Tech Answered Logo Tech Answered Logo
Sign InSign Up

Tech Answered

Tech Answered Navigation

  • Home
  • Tutorials
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • About Us
  • Blog
  • Contact Us
Home / Questions /Q 549
Next
In Process
Rohan Rathore
Rohan Rathore

Rohan Rathore

  • India
  • 4 Questions
  • 0 Answers
  • 0 Best Answers
  • 20 Points
View Profile
  • 0
Rohan Rathore
Asked: August 29, 20202020-08-29T20:11:05+05:30 2020-08-29T20:11:05+05:30In: Database Related

Why do we use packages in Oracle when we can use procedures?

  • 0

I don’t understand when I can simply create multiple procedures in my DB. Why do I need to create a package?

oraclepackagesprocedures
  • 2
  • 1,033
  • 0
  • 0
Answer
Share
  • Facebook

    Related Questions

    • How to add the Authentication package to the Android studio
    • what are SQL Joins? What are the types of SQL Joins?

    2 Answers

    1. Sweta

      Sweta

      • India
      • 2 Questions
      • 34 Answers
      • 7 Best Answers
      • 138 Points
      View Profile
      Sweta
      2020-08-30T12:04:32+05:30Added an answer on August 30, 2020 at 12:04 pm

      Packages provide the following advantages:

      Cohesion: all the procedures and functions relating to a specfic sub-system are in one program unit. This is just good design practice but it’s also easier to manage, e.g. in source control.

      Constants, sub-types and other useful things: there’s more to PL/SQL than stored procedures. Anything we can define in a package spec can be shared with other programs, for instance user-defined exceptions.

      Overloading: the ability to define a procedure or function with the same name but different signatures.

      Security: defining private procedures in the package body which can only be used by the package because they aren’t exposed in the specification.

      Sharing common code: another benefit of private procedures.

      We only need to grant EXECUTE on a package rather than on several procedures.

      As described in Oracle docs, packages are good because of:

      • modularity
      • easier application design
      • information hiding
      • added functionality
      • better performance

      Details on each reason are explained in docs.

      Hope this helps.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    2. Urmila Pal

      Urmila Pal

      • Asp.net Developer with Oracle database connectivity
      • 1 Question
      • 3 Answers
      • 1 Best Answer
      • 36 Points
      View Profile
      Urmila Pal Asp.net Developer with Oracle database connectivity
      2020-09-03T13:39:08+05:30Added an answer on September 3, 2020 at 1:39 pm

      Whenever you call a procedure or any subprogram in your code it will be loaded into the cache memory after the compilation process. And only after that, it can result in your desired output. 

      There are some advantages of packages over procedures:

      1. Performance: If you call a package, all the subprograms will be loaded in one time and then you can execute whichever procedure or function you need to. Which saves the compilation time for multiple procedures and increases the performance.

      Whereas if you write multiple procedures they will take their separate compilation time which can reduce your work performance and can increase the wait time.

      2. Re-compilation: There is no need to re-compile the package unless the specification of the package is also changed along with the body of the package.

      3. I/O parameters: In case of packages, once the package has been loaded in the memory there is no need to specify the input-output parameters. 

      On the other hand, procedures will need their separate input-output parameters.

      I hope I was able to explain the differences. If you like this answer, please like and share my answer.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    Leave an answer

    Leave an answer
    Cancel reply

    Browse

    Sidebar

    Ask A Question

    More Questions

    • dynamicapps5

      How to Write VBA Code To Auto delete Blank Or

    • Aniya

      How to install my SQL database on laptop with sample

    • Abrar

      What is mean by cascading style sheets (CSS) ? What

    • Abrar

      What is HTML ( hyper text markup language) how is

    • Abrar

      What is mean by Normalisation in data base management system?what

    • Abrar

      What is mean by structured query language (SQL) and how

    • Abrar

      What is Electronic data interchange (EDI) how does it work

    • Mr.Condoluci

      Browse internal hard drive

    Stats

    • Questions 1,992
    • Answers 2,102
    • Posts 12
    • Best Answers 73

    Related Questions

    • Ramya834

      How to add the Authentication package to the Android studio

    • Rohan Rathore

      what are SQL Joins? What are the types of SQL Joins?

    Explore

    • Home
    • Communities
    • Questions
      • New Questions
      • Trending Questions
      • Must read Questions
      • Hot Questions
    • Polls
    • Tags
    • Badges
    • Users
    • Help

    Footer

    Recent Comments

    • muller on how to solve export problem in kinemaster
    • muller on how to solve export problem in kinemaster
    • muller on how to solve export problem in kinemaster
    • AaronBlackburn on why can’t i find my message requests on instagram
    • shree on How to use philips citrus press juicer 25 watts Demo
    Ask A Question

    Archives

    Tags

    laptop buying guide (1) limit google news notifications (1) printer buying guide (1) stop google news notifications (1) turn off google news notifications (1)

    Social media

    © 2023 @ Techanswered.com.
    Terms, Privacy policy & Sitemap.

    Insert/edit link

    Enter the destination URL

    Or link to existing content

      No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.