Re: Trying to copy the value of a SDO_GEOMETRY column from one table to another
Anthony Tuininga <[email protected]> Tue, 23 Feb 2016 16:25:05 -0700
| Newsgroups | gmane.comp.python.db.cx-oracle |
|---|---|
| Message-ID | <CAE1XR-5QSF+Pcrgw9JQAAXx3tZ3Che8rNf63t85=eVrm8V+EoA@mail.gmail.com> |
Hi Michael, The current code in the source repository will allow you to do this now. There is also an example that demonstrates how to create an SDO_GEOMETRY object from scratch. This will (at some point) become 5.3 but you can use it today if you're up for building it yourself -- since you're on Linux that isn't too difficult. Anthony On Sun, Feb 7, 2016 at 7:13 AM, Michael Huber <[email protected]> wrote: > Hi, > > I'm querying from a table with a SDO_GEOMETRY column and want to store the > content of this column to another table. If I do so, I'm receiving the > following exception: > > cx_Oracle.NotSupportedError: Variable_TypeByValue(): unhandled data type > cx_Oracle.OBJECT > > Please find a basic example below: > > Python 3.5.1 (default, Jan 20 2016, 15:13:56) > [GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux > Type "help", "copyright", "credits" or "license" for more information. > >>> import cx_Oracle > >>> con = cx_Oracle.connect('user1/pass1@hostname:1521/TESTDB') > >>> cur = con.cursor() > >>> > >>> cur.execute("SELECT * FROM USER1.SOURCE_TABLE WHERE id = 1") > <cx_Oracle.Cursor on <cx_Oracle.Connection to user1@hostname:1521/TESTDB>> > >>> source_data = cur.fetchall() > >>> > >>> print(source_data) > [(1, 'testvalue', <cx_Oracle.OBJECT object at 0x7f39e2561c70>)] > >>> > >>> cur.execute("INSERT INTO USER1.TARGET_TABLE VALUES (:1, :2, :3 )", > [source_data[0][0], source_data[0][1], source_data[0][2] ]) > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > cx_Oracle.NotSupportedError: Variable_TypeByValue(): unhandled data type > cx_Oracle.OBJECT > >>> > > Is it not supported to write the content of a SDO_GEOMETRY column back to > an Oracle database? Thanks in advance! > > Best, > Micheal > > > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 > _______________________________________________ > cx-oracle-users mailing list > cx-oracle-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 _______________________________________________ cx-oracle-users mailing list cx-oracle-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/cx-oracle-users