Re: Statement preparing
On Tue, Jan 29, 2002 at 08:33:46PM -0600, Paul DuBois wrote: > 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.) I think the further problem is that the MySQL protocol doesn't have any way to specify that. I recall some discussion on the internals list a month or so ago about extending the protocol to make that sort of stuff easier to do. Yeah, in fact, I even remember asking how that would interact with the query cache. Jeremy -- Jeremy D. Zawodny, <[EMAIL PROTECTED]> Technical Yahoo - Yahoo Finance Desk: (408) 349-7878 Fax: (408) 349-5454 Cell: (408) 685-5936 MySQL 3.23.41-max: up 27 days, processed 591,117,757 queries (252/sec. avg) - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Statement preparing
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 - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Statement preparing
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? Any help/comments would be appreciated. TIA. Pedro - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php