[DB-SIG] cx_Oracle 2.5

M.-A. Lemburg mal@lemburg.com
Thu, 18 Jul 2002 18:55:44 +0200


Kevin Jacobs wrote:
> 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.

Let's start simple and get more complicated afterwards.

-- 
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
_______________________________________________________________________
eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,...
Python Consulting:                               http://www.egenix.com/
Python Software:                    http://www.egenix.com/files/python/