[cx-oracle-users] Trying to copy the value of a SDO_GEOMETRY column from one table to another
Brought to you by:
atuining
|
From: Michael H. <mhu...@gm...> - 2016-02-07 14:13:33
|
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
|