We are using DB2 ver 7.2 for Windows. The developers are developing lot of stored procedures using the stored procedure builder.
I noticed that most of the stored procedures have a PREPARE SQL Stmt to generate the SELECT statements. Meaning, the SQL statements are dynamic and that the plan is created at run time.
Doesn't a PREPARE have more overheads than a Static SQL ? Then, why is it such a common practice to use PREPARE stmt ? Even many of the books and manuals have sample SPs using PREPARE stmt ?
Would it enhance the performance if the SPs are modifed to remove the PREPARE ? ANd how much gain is achived by removing the prepare ?
thanks.
Anil