[DB-SIG] Preparing statement API

Greg Stein gstein@lyra.org
Wed, 26 Jan 2000 18:46:33 -0800 (PST)


On Wed, 26 Jan 2000, M.-A. Lemburg wrote:
> Hrvoje Niksic wrote:
>...
> > This is very close to what I proposed, except that my cursor.prepare()
> > returns the statement (which you provide through cursor.command).
> > This allows one to prepare more than one statement using one cursor.
> 
> Maybe this is just an ODBC thing, but you cannot prepare more
> than one statement on a cursor (in ODBC the notion of cursors
> is captured by the HSTMT or statement handle). For ODBC, your
> .prepare() function would have to return a new cursor.

This is common to all databases that I know of -- a cursor can only deal
with a single statement at a time. You cannot prepare multiple statements
on a given cursor: almost by definition, the cursor is used to hold the
results of a prepare() operation (it also holds execution context during
a fetch; actually, prepare is just one phase of a fetch).

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/