Re: [cx-oracle-users] UPDATE examples
Brought to you by:
atuining
From: Anthony T. <ant...@gm...> - 2010-11-18 16:09:01
|
Hi, For "examples" I can suggest looking at the code in cx_PyOracleLib and cx_OracleTools http://cx-pyoraclelib.sourceforge.net/ http://cx-oracletools.sourceforge.net/ Those ones are "real-world". In the end, however, whether you are using updates, selects, inserts, deletes it all works exactly the same way. See below. cursor.execute(""" update sometable set somecolumn1 = :somevalue1, somecolumn2 = :somevalue2 where somecolumn3 = :somevalue3""", somevalue1 = 5, somevalue2 = "Another string of some sort", somevalue3 = "The primary key or some other such") Hope that helps you out. Anthony On Thu, Nov 18, 2010 at 8:44 AM, Robert <web...@gm...> wrote: > Anurag, yes, thanks but I'm really looking for "real-world" examples, > i.e. ones that uses bind variable/parameters in WHERE clause. > The examples in cx_Oracle doc all seem to be simple type like you provided. > > > On Thu, Nov 18, 2010 at 1:27 AM, Anurag Chourasia > <anu...@gm...> wrote: >> Hi Robert, >> Are you looking at something like this? >> connection = cx_Oracle.connect(Connection_String) >> cursor = connection.cursor() >> query = "UPDATE <TABLE> SET <COLUMN>=<VALUE> WHERE <Where Clause>" >> cursor.execute(str(query)) >> connection.commit() >> Regards, >> Anurag > > ------------------------------------------------------------------------------ > 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/msIE9-sfdev2dev > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |