[DB-SIG] SQL statement parse for Oracle

Greg Stein gstein@lyra.org
Mon, 4 Feb 2002 12:45:17 -0800


On Mon, Feb 04, 2002 at 01:42:08PM +0100, M.-A. Lemburg wrote:
> Hi Greg,
> 
> welcome back to the list :-)

:-)

>...
> Sure, but only by actually executing the statement. That may not be
> what you want, though, e.g. testing whether a SQL statement is valid
> or not is not possible using the existing DB API methods since you 
> always execute the statement.

For those cases where you actually need to test some random SQL statement,
you're right. How often does that truly happen?

[ rhetorical question; the answer is below... ]

> It is also not possible to setup a
> few prepared cursors before actually using them for execution. The

Setting up cursors beforehand is a rather bogus reason. You're just shifting
the timing of the preparation. The app will perform the same if you wait for
the first usage. And if the cursors don't ever get used, then you actually
have a benefit :-)

>...
> > Adding prepare() only monkeys up the interface. Now you have a separate
> > call. But wait! That call might not do anything.
> 
> .prepare() is not needed in the sense that you have to call it
> to execute SQL; .execute() will do the .prepare() for you.

Of course :-)

[ I learned all about prepare() back in '89 when I worked for Oracle... ]

> > It just seems senseless to keep throwing more and more APIs in. When the
> > functionality is *already* there, then keep the API simple.
> 
> We are keeping the API simple. 
> 
> The .prepare() method as well as
> a bunch of other methods are only standardized *extensions* to the
> DB API,

Ah. Now we have the answer :-)  If it is described as a standard extension,
then everything is hunky dory... hehe

> The DB API extensions are not part of what is required for DB API
> compatibility. They only form guidelines for DB API extensions
> which have become rather common in existing DB API compatible 
> packages.

Yup. It was a bit unclear whether you were talking about extending the DB
API interface, or adding to the DB API Extensions. All clear now! Thanks.

/me returns to lurking... :-)

Cheers,
-g

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