Home > Oracle Database / Applications Tips > Oracle database developer tips > Why use stored procedures?
Oracle Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ORACLE DATABASE DEVELOPER TIPS

Why use stored procedures?


Parthasarathy Mandayam
07.28.2005
Rating: -3.58- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


Stored procedures offer several distinct advantages over embedding queries in your Graphical User Interface (GUI). Your first thought may be: "Why tolerate the added development overhead?" After seeing the advantages, you may change your mind.

Advantage 1: Stored procedures are modular. This is a good thing from a maintenance standpoint. When query trouble arises in your application, you would likely agree that it is much easier to troubleshoot a stored procedure than an embedded query buried within many lines of GUI code.

Advantage 2: Stored procedures are tunable. By having procedures that handle the database work for your interface, you eliminate the need to modify the GUI source code to improve a query's performance. Changes can be made to the stored procedures--in terms of join methods, differing tables, etc.--that are transparent to the front-end interface.

Advantage 3: Stored procedures abstract or separate server-side functions from the client-side. It is much easier to code a GUI application to call a procedure than to build a query through the GUI code.

Advantage 4: Stored procedures are usually written by database developers/administrators. Persons holding these roles are usually more experienced in writing efficient queries and SQL statements. This frees the GUI application developers to utilize their skills on the functional and graphical presentation pieces of the application. If you have your people performing the tasks to which they are best suited, then you will ultimately produce a better overall application.

In short, queries are best handled via stored procedures. While the initial development overhead is greater, you will more than make up for the investment down the line.


More information from SearchSQLServer.com

  • Tip: A simple stored procedure to list database objects by selected type(s)
  • Tip: Stored procedures and remote procedure calls
  • Tech Article: Replicate stored procedure execution

  • Do you have comments on this tip? Let us know.

    Rate this Tip
    To rate tips, you must be a member of SearchOracle.com.
    Register now to start rating these tips. Log in if you are already a member.




    Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



    RELATED CONTENT
    Oracle database administrator
    Understanding SQL string functions
    What is the difference between a database engineer, architect and administrator?
    Import on one table from dump file
    Error during RMAN backup
    Can I drop a column in SYS schema?
    STATSPACK tool: transaction vs. execution measurement
    Should I port from Microsoft Access?
    How can I find statistics on total memory usage and database connections?
    Installing multiple Oracle homes
    Modifying SYS password in a RAC environment

    Oracle database developer tips
    How do you create a link between two databases inside a stored procedure?
    PL/SQL do's and don't's: Five questions with Steven Feuerstein
    Mike Ault's Oracle "good practices": Oracle coding
    Easy Oracle PL/SQL programming: Assignments, initializations and NULLs
    Introduction to BPEL
    SQL puzzles and answers: Finding equal sets
    Developer and DBA: Working together for greater efficiency
    NULLs in WHERE clauses can be deceptive
    The Top 10 (more or less) J2EE best practices
    Build a servlet-based application that executes SQL statements against a database

    RELATED RESOURCES
    2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
    Search Bitpipe.com for the latest white papers and business webcasts
    Whatis.com, the online computer dictionary

    DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



    Oracle Development Solutions - SQL, J2EE, XML, SOA
    HomeNewsTopicsTipsAsk the ExpertsMultimediaWhite PapersProductsBlogs
    About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
    SEARCH 
    TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

    TechTarget Corporate Web Site  |  Media Kits  |  Site Map




    All Rights Reserved, Copyright 2003 - 2009, TechTarget | Read our Privacy Policy
      TechTarget - The IT Media ROI Experts