logo

CuriousTab

CuriousTab

Discussion


Home Interview Technology See What Others Are Saying!
  • Question
  • Define stored procedure. What are its advantages and disadvantages?


  • Correct Answer
  • A stored procedure is a segment of declarative SQL statements stored inside the database catalog A stored procedure can be invoked by triggers, other stored procedures or applications such as Java, C#, PHP, etc Advantages - Typically stored procedures help increase the performance of the applications Once created, stored procedures are compiled and stored in the database However MySQL implements the stored procedures slightly different MySQL stored procedures are compiled on demand After compiling a stored procedure, MySQL puts it to a cache And MySQL maintains its own stored procedure cache for every single connection If an application uses a stored procedure multiple times in a single connection, the compiled version is used, otherwise the stored procedure works like a query - Stored procedures helps reduce the traffic between application and database server because instead of sending multiple lengthy SQL statements, the application has to send only name and parameters of the stored procedure - Stored procedures are reusable and transparent to any applications Stored procedures expose the database interface to all applications so that developers don?t have to develop functions that are already supported in stored procedures - Stored procedures are secure Database administrator can grant appropriate permissions to applications that access stored procedures in the database without giving any permission on the underlying database tables Disadvantages - If you use a lot of stored procedures, the memory usage of every connection that is using those stored procedures will increase substantially In addition, if you overuse a large number of logical operations inside store procedures, the CPU usage will also increase because database server is not well-designed for logical operations - A constructs of stored procedures make it more difficult to develop stored procedures that have complicated business logic - It is difficult to debug stored procedures Only few database management systems allow you to debug stored procedures Unfortunately, MySQL does not provide facilities for debugging stored procedures -It is not easy to develop and maintain stored procedures Developing and maintaining stored procedures are often required specialized skill set that not all application developers possess This may lead to problems in both application development and maintenance phases 


  • More questions

    • 1. What is CRR rate?
    • Discuss
    • 2. Which among the following are not access Specifiers in C++?

    • Options
    • A. Public
    • B. Protected
    • C. Default
    • D. Private
    • Discuss
    • 3. In which year, the first bank of India "Bank of Hindustan" was established ?

    • Options
    • A. 1677
    • B. 1770
    • C. 1796
    • D. 1831
    • Discuss
    • 4. What could be the bucket size if collision and overlapping occur at same time?

    • Options
    • A. 2
    • B. 0
    • C. 1
    • D. 4
    • Discuss
    • 5. Default constructor accepts how many arguments?

    • Options
    • A. one
    • B. two
    • C. three
    • D. None
    • Discuss
    • 6. What are the mandatory part to present in function pointers?

    • Options
    • A. &
    • B. retrun values
    • C. data types
    • D. none of these
    • Discuss
    • 7. Which of the following can derived class inherit?

    • Options
    • A. members
    • B. functions
    • C. both a & b
    • D. None of the above
    • Discuss
    • 8. What kind of object is modifying sequence algorithm?

    • Options
    • A. Function template
    • B. Class template
    • C. Method
    • D. None of these
    • Discuss
    • 9. Fixed Foreign Exchange rate can be changed by

    • Options
    • A. SEBI
    • B. Ministry of Finance
    • C. RBI
    • D. All of the above
    • Discuss
    • 10. The shortcut key to quit from tally is

    • Options
    • A. CTRL + Q
    • B. CTRL + ESC
    • C. CTRL + T
    • D. CTRL + P
    • Discuss


    Comments

    There are no comments.

Enter a new Comment