Re: pdo prepare()

From: Date: Fri, 30 Sep 2005 14:50:36 +0000
Subject: Re: pdo prepare()
References: 1 2  Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-3030@lists.php.net to get a copy of this message
On 9/30/05, Dan Scott <denials@gmail.com> wrote: > On 9/30/05, Lukas Smith <lsmith@php.net> wrote: > > Hi, > > > > It seems to me like prepare() does not actually prepare the query in the > > database? Instead it seems to wait until I do the first execute()? This > > seems to delay the actual error in a slightly confusing way imho. > > <snip> > > Hi Lukas: > > It's quite common for database drivers to use a deferred prepare() > call to avoid extra trips to the database server. In DB2, for example, > deferred prepare() is used by default: > > http://publib.boulder.ibm.com/infocenter/db2help/topic/com.ibm.db2.udb.doc/ad/r0000635.htm > > You can normally override that behaviour; for example the ODBC > specification offers the SQL_ATTR_DEFERRED_PREPARE statement attribute > -- but for performance reasons deferred prepare() is the recommended > default. > Hmm, well actually SQL_ATTR_DEFERRED_PREPARE is a DB2 extension to the ODBC / CLI specification. But a darned good extension :) Dan

« previous php.pecl.dev (#3030) next »