Mega Code Archive

 
Categories / Delphi / ADO Database
 

Odbc and db2 dont do prepares

Question: How come I see no performance improvement when preparing a query against an ODBC datasource or a DB2 datasource? Answer: IN BDE versions prior to 5.10, The BDE connection to DB2 and ODBC do not support prepare. Performing a prepare causes a no-op to occur. BDE 5.10 and later supports Prepare in a DB2 connection. However, executing two prepared statements in a row will generate a General SQL Error. To avoid getting the General SQL Error Unprepare after each SQL execution and then Prepare again before executing the statement again. ODBC still does not support Prepare.