DBAsupport.com Forums - Powered by vBulletin
Results 1 to 7 of 7

Thread: Package vs Standalone Procedures

  1. #1
    Join Date
    Mar 2001
    Posts
    287

    Package vs Standalone Procedures

    What's the benefit of creating functions and procedures inside of a package instead of creating standalone functions and procedures? Any performance benefit?

    Thank you.

  2. #2
    Join Date
    Oct 2001
    Location
    GA, USA
    Posts
    79
    I am not sure about any performance gain by putting procedure/function together into package. It is entirely depend on your application requirement, database design and your application logic for example if you are developing CRM or ERP module and one procedure is calling other procedure or function or you have too many procedure is depend on each other than as a developer I would like to put some amount of set of procedure or function together into one meaningful package for particular task that makes developers life easier to maintain and debug the application code.
    Circumstances do not rise to meet our expectation. Embrace what you actually get. Open your eyes. See things for what they really are Thereby sparing yourself the pain of false attachements.

  3. #3
    Join Date
    Dec 2000
    Location
    Brazil / São Paulo
    Posts
    97
    Yes, profit of performace and memory.
    Possibility to use global variable.
    Márcio de Souza Almeida
    DBA Oracle / SQLServer / PostgreSQL
    Rua Cupa, 139 Apto 85 A
    Penha - São Paulo - SP
    03640-000 - Brasil
    http://www.directory.com.br

  4. #4
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    4,166
    Where I work we try to take common business functions/logic and encapsulate them into a packages. We have a package for logging error messages. We have another package that stores all of the reports.

    The advantage is that each procedure/function in a package that uses common code with another procedure/function in the same package can call the same procedure/function. We also use global variable as constants. I.E. for things that aren't supposed to change, but might change. Which makes the code more readable and flexible. It also means we don't always have to pull the information from a table.

    Code that is completely unrelated to any other code could be a stand alone procedure/function. However, I like the idea of compartmentalizing code into packages. I find it easier to maintain. But to each their own.

  5. #5
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    Read this, and then use packages
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

  6. #6
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    Originally posted by slimdave
    Read this, and then use packages
    Damn, I was just looking for that... You beat me to the punch...
    Jeff Hunter

  7. #7
    Join Date
    Mar 2001
    Posts
    287
    Thank you all!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width