Re: [cx-oracle-users] cx_Oracle.InterfaceError: not a query
Brought to you by:
atuining
From: Anthony T. <ant...@gm...> - 2010-10-08 15:55:51
|
Ok, can you show the code that is causing the problem? Is it consistently failing with that one statement or does it have to be after a bunch of other statements first? If you can send me a simple script that demonstrates the problem I'll look at it. I've never run into that problem myself unless I accidentally attempted to fetch from the cursor -- but that doesn't mean there isn't some strange bug lurking.... :-) Anthony On Fri, Oct 8, 2010 at 8:52 AM, John Nielson <mr....@gm...> wrote: > Right... > > I'm using cursor.execute(my_statement) to perform the update. I am aware > that update statements aren't queries; however, I'm also aware that the > execute method is used to perform updates. The script iterates through a > whole slew of update statements that work just fine before blowing up on > this one. > > > > On Thu, Oct 7, 2010 at 10:28 AM, Anthony Tuininga > <ant...@gm...> wrote: >> >> Hi, >> >> Not sure exactly what you are trying to accomplish but showing the >> exact Python code you are executing would be helpful. In any case, the >> statement shown below is definitely not a query -- it looks very much >> like an update statement which does not query information but updates >> information in the database. So you should be simply doing this >> >> cursor.execute(your_statement) >> >> Do not attempt to fetch from the cursor, though. That will generate >> the "not a query" exception. Make sense? >> >> Anthony >> >> On Thu, Oct 7, 2010 at 8:29 AM, John Nielson <mr....@gm...> >> wrote: >> > All: >> > >> > I have a script that performs a bunch of updates. However, after >> > attempting >> > to perform the following query (carriage returns intentional): >> > >> > update NIELSONJ.MYTABLE set COLUMN_1 = '"double quotes" >> > ''single quotes'' >> > En - dash >> > Em-dash >> > . bullet >> > ' where COLUMN_2 = -2395 >> > >> > >> > I get the following error: >> > >> > cx_Oracle.InterfaceError: not a query >> > >> > >> > I've copied and pasted the query into my IDE, executed it, and it runs >> > just >> > fine. It's definitely a query! I am mystified. >> > >> > Please note what kinds of quotes those are and that all single quotes >> > within >> > the query are doubled to avoid terminating the update string. The >> > script is >> > intended to cleanse the database of data containing weird characters >> > like >> > smart quotes (e.g. left single quotes are replaced with straight single >> > quotes). >> > >> > -- >> > John Nielson >> > mr....@gm... >> > (504) 344.7225 >> > >> > >> > ------------------------------------------------------------------------------ >> > Beautiful is writing same markup. Internet Explorer 9 supports >> > standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. >> > Spend less time writing and rewriting code and more time creating great >> > experiences on the web. Be a part of the beta today. >> > http://p.sf.net/sfu/beautyoftheweb >> > _______________________________________________ >> > cx-oracle-users mailing list >> > cx-...@li... >> > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users >> > >> > >> >> >> ------------------------------------------------------------------------------ >> Beautiful is writing same markup. Internet Explorer 9 supports >> standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. >> Spend less time writing and rewriting code and more time creating great >> experiences on the web. Be a part of the beta today. >> http://p.sf.net/sfu/beautyoftheweb >> _______________________________________________ >> cx-oracle-users mailing list >> cx-...@li... >> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > > > -- > John Nielson > mr....@gm... > (504) 344.7225 > > ------------------------------------------------------------------------------ > Beautiful is writing same markup. Internet Explorer 9 supports > standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. > Spend less time writing and rewriting code and more time creating great > experiences on the web. Be a part of the beta today. > http://p.sf.net/sfu/beautyoftheweb > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > |