RE: Prepared statement vs Exec sql insert/update/select
Posted in 1999
> Is there any benefit to preparing and executing sql statements > rather than just having them in an exec sql insert/update/select.... [Bill Raper] In the Informix world, there is a very significant benefit. This is in the fact that the optimizer processes are run only once for a query that is prepared and executed more than once in a program. The complexity of the query has nothing to do with whether you will receive a benefit. The fact that the query optimizer runs only once in these instances is the reason for significant performance gains. Actually, I almost completely agree with your consultant who said to use prepares everywhere. The only exception to that rule would be an SQL that is run once-and-only-once in a program.