Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stored procedures vs. Dynamic SQL

Status
Not open for further replies.

varshan09

Programmer
Oct 28, 2003
45
IN
Hi,
We came to know the performance of stored procedures and parameterized SQLs(Dynamic queries) are same.

Do we use dynamic sqls mostly in our project? What is the overhead of using stored procedures in DB2?

Thanks
Varsha
 
Stored procedures are quicker because they have had a BIND statement run against them. Dynamic SQL has to prepare the statements at execution time which incurs an runtime overhead. Dynamic SQL is normally used when certain important factors (like table name) are not know when the program is compiled etc.

Marc
 
I wouldn't assume that using stored procedures would make it more difficult to port your application. We've recently done this and in fact it's the SQL in the application that presented the bigger headache.

 
kathi,
I totally agree with you, as SP do make it easier to port. You simply rework that layer and you are ready to go.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top