[DB-SIG] PEP 249

Konjkov Vladimir konjkov.vv at gmail.com
Wed Jan 23 07:14:41 CET 2008


When I'm implementin on C my Python module that are used to access
ODBC 2.0 database, I can't found description in PEP-0249 about the
case when one .executeXXX follows another on the same cursor object.

I think that after .executeXXX cursor can only be
fetchedXXX or closed. Reexecution permited and raised exception.
That's because .executeXXX method calling SQLPrepare and
and next SQLPrepare posible only when SQLCloseCursor() or
SQLFreeStmt() with the SQL_CLOSE option called.

But on C-level reexecution is posible.

"Once the application has processed the results from the SQLExecute() call,
it can execute the statement again with new (or the same) parameter values."

Problem is that no .Prepare(Statement) method is not present in Cursor
oblect.

I think it will be better if connection method of cursor have to do the
SQLPrepare and only prepare the statemnet when creatin new python cursor
object
C = cnxn.cursor(STATEMENT),
and C.execute([parameters]) will only execute or reexecute the statemnet
with optional parameters list.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/db-sig/attachments/20080123/4a51398e/attachment.htm 


More information about the DB-SIG mailing list