?
Solved

Prepared Statements V Stored Procedures with RDO

Posted on 1998-07-22
2
Medium Priority
?
208 Views
Last Modified: 2010-05-03
We are using RDO 2.0.
Does anyone have any information regarding the relative merits of using prepared statements or stored procedures.

Particularly any quantative performance figures would be good but I'm assuming that these would be implementation specific.

Are there any views for the kinds of transactions/implementation that suit either approach best?
0
Comment
Question by:slinky
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Expert Comment

by:vinoopauls
ID: 1466398
stored procedures always
0
 

Accepted Solution

by:
zimmy earned 200 total points
ID: 1466399
I would've sworn that I answered this last Thursday. Guess it got lost in the bit bucket. Oh well . . .

As a general rule, stored procedures are better than prepared statements; but there are always exceptions and special cases.

Here are some of the main arguments, pro and con.

Stored procedures execute faster because they are precompiled and optimized, whereas prepared statements must go through the parse, compile and optimize steps every time. (You're right, though. The improvement is so implementation specific that no one even bothers to try and do a general analysis.)

Stored procedures are better because, as a general rule, you shouldn't expose your tables to ANYONE. You should build views and stored procs as needed. This keeps control of the database where it belongs, with the developer and dba.

Stored procedures are better because they embody business rules that belong in the database. If your database has a rule that (for example) allows an account to be overdrawn by no more than $5.00, and three years later you want to change that amount to be $20.00, you don't have to track down every piece of client-side software that's been written in the interim; you only have to change the stored procedure. Nor do you ever have to worry that someone might not have received the word.

HOWEVER!

Stored procedures don't work if your query wants to return a column set that's defined at run time. That is, the columns specified in a SELECT statement can't be dynamic. For that, you need prepared statements.

That's about it. Hope it helps. If you have more specific questions, I'd be glad to give them a shot.

Zimmy
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month10 days, 20 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question