[DB-SIG] db module wrapper
Andy Todd
andy47 at halfcooked.com
Fri Aug 20 16:34:32 CEST 2004
Marc Colosimo wrote:
>
> On Aug 19, 2004, at 11:57 AM, M.-A. Lemburg wrote:
>
>> Marc Colosimo wrote:
>>
[snip]
>
>> After all binding
>> parameters exist to make all this quoting unnecessary and
>> indeed, many drivers pass the SQL string and the parameters
>> well separated to the database.
>
>
> not pgdb (_quoteparams) or cx_oracle (Cursor_SetBindVariables). I
> couldn't check psycopg because the links from freshmeat are dead.
>
Call me Mr Picky, but that is not true for cx_Oracle. It uses a feature
of Oracle called bind variables. For an explanation see;
http://www.rittman.net/archives/000832.html
The function Cursor_SetBindVariables in Cursor.c of cx_Oracle simply
unpacks the values passed to the execute statement. Quoting and other
esoteric conversion requirements and performed by the Oracle software.
>> The database then builds
>> an access path using the SQL string (with binding parameters)
>> and runs the access path against the parameters that are
>> specified as separate part of the request.
>>
>
>
As ever, Marc-Andre is correct. The key reason for this is performance
as parsing *can* have quite a big overhead.
Regards,
Andy
--
--------------------------------------------------------------------------------
From the desk of Andrew J Todd esq - http://www.halfcooked.com/
More information about the DB-SIG
mailing list