Re: [cx-oracle-users] using bind variables to insert into xmltype colums
Brought to you by:
atuining
From: Charl P. B. <cp...@gm...> - 2005-04-08 16:39:29
|
On Apr 8, 2005 6:10 PM, Anthony Tuininga <ant...@gm...> wrote: > connection = cx_Oracle.Connection("user/pw@tns") > cursor = connection.cursor() > cursor.setinputsizes(value = cx_Oracle.CLOB) > cursor.execute("insert into xmltable values (:value)", > value = "A very long XML string") > > where in my case the xml was about 50 KB. Hope this helps! If not, can > you post the exact code you are using so I can see if anything obvious > shows up. Thanks. Thank you very much for the quick answer Anthony! It seems in my example I forgot the "setinputsizes()"; I've now added this and I don't see the ORA-01461 message anymore, but rather a different error message: "ORA-00932: inconsistent datatypes: expected - got CLOB" I've attached a complete and simple example that illustrates this, at least on my setup. It also creates the necessary table called "xmltable". It drops the old "xmltable", so be careful. After changing the username/password, you have to do "import simple_ex; simple_ex.main()" from the python interpreter. Thanks for looking into this! Regards, Charl -- charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/ |