Re: [cx-oracle-users] Distinguishing between select and update/delete/insert
Brought to you by:
atuining
From: Mihai I. <mi...@re...> - 2006-01-11 23:58:14
|
On Wed, Jan 11, 2006 at 06:55:03PM -0500, Mihai Ibanescu wrote: > Hi, > > Is there a way one can prepare a query and determine its type? > (select/update/insert/delete). > > The reason: executemany() only applies to update/insert/delete. I have a > module that executes queries passed in by the user, and gets the bind params > from a .csv file. It would be nice to know when I can use execute vs. > executemany. It also helps to know if one has to fetch a result set (in case > of a select) or not do anything (for insert/update/delete). > > I know in OCI you can check the type by comparing to OCI_STMT_SELECT et al - > is the statement type somewhat exposed at the Python level? ... to reply to myself, exposing self->satementType as set by Cursor_GetStatementType to python, that's kind of what I'm looking for. I don't see it done, would others find it to be valuable? It would probably require a new read-only attribute of a Cursor object exposed, and a bunch of constants OCI_STMT_* defined. Misa |