Preparing TSQLQuery lazarus / 16-Databases ---------------------------------------------------------------------- sandeep_c24 · 2009-03-03 10:29 Could anyone give an example of how to use Prepared statements using TSQLQuery with Mysql5. Does it work with TSQLQuery? Sandeep ---------------------------------------------------------------------- Loesje · 2009-03-03 20:47 Can you give me an example of using unprepared queries? Because that's truly impossible... A query is prepared before you execute it. When you execute it twice it isn't prepared for a second time. ---------------------------------------------------------------------- sandeep_c24 · 2009-03-03 22:20 Does that mean if I execute a query and close it and then again execute it it is not going to be prepared. For how long does the query remain prepared? Is it for the duration of the connection? Sandeep ---------------------------------------------------------------------- Loesje · 2009-03-27 13:12 When you _open_ a query and then close it an then re-open it, it doesn't prepare the query for the second time. The query is prepared until you change it's sql-statement, call .UnPrepare or when the transaction or connection closes.