[DB-SIG] cx_Oracle 2.5

Kevin Jacobs jacobs@penguin.theopalgroup.com
Wed, 17 Jul 2002 16:43:05 -0400 (EDT)


On Wed, 17 Jul 2002, M.-A. Lemburg wrote:
> > Got one -- except that it is really slow, and needs to be taught all the
> > details of the various SQL dialects.  (i.e., it is a full SQL parser)
> > A much simpler verion could easily be written that only knows how to
> > tokenize SQL and about a few syntactic landmarks.
> 
> I don't think you need to tokenize the SQL. The API
> should take the paramstyle used in the SQL as parameter and
> then you can extract the positions of the parameters
> easily using e.g. re. You will only need to watch out for
> quoting.

Once we've dealt with quoting, we've essentially done most of the work
required to tokenized the input.  We may also need to detect the end of
statement, since some backends allow multiple statements to be executed at a
time, and I'm not sure what happens when nested queries include bound
parameters.  It's only simple if you leave reporting errors to the backend.

-Kevin

--
Kevin Jacobs
The OPAL Group - Enterprise Systems Architect
Voice: (216) 986-0710 x 19         E-mail: jacobs@theopalgroup.com
Fax:   (216) 986-0714              WWW:    http://www.theopalgroup.com