List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:January 30 2002 2:33am
Subject:Re: Statement preparing
View as plain text  
At 13:34 +0100 1/29/02, Pedro Alvarez-Tabio wrote:
>Hello,
>
>I'm developing an application with MySQL using the C API. I would like
>to implement a mechanism to prepare some queries in advance and just
>bind the parameters before execution. I have found in the documentation
>a way to do that using the DBI Interface but not for C API. Is it
>possible to prepare statements for execution in an application built
>with the C API?

No.  That also means you can't do it with DBI, because the DBI MySQL
driver is built on top of the C API.  (DBI supports the syntax, but
MySQL doesn't take advantage of it, in the sense that it doesn't
store query plans that can be reused when you prepare a statement.)

The work on the MySQL 4.x query cache that's going on now may change this
picture, but from my understanding of the cache, it's the *final* form
of the query that is cached, not its form before data values are bound
to the placeholders.  (Someone correct me if that's incorrect.)

>
>Any help/comments would be appreciated. TIA.
>Pedro

Thread
Statement preparingPedro Alvarez-Tabio29 Jan
  • Re: Statement preparingPaul DuBois30 Jan
    • Re: Statement preparingJeremy Zawodny30 Jan