I would like transfer spatial data from PostGIS to Oracle Spatial. I want to use Python's modules psycopg2 and cx_oracle. Transfer Oracle > PostGIS is OK, but in opposite version I have problem with a geometry column. The important part is:
cursorP.execute("select fid, kod, st_asBinary(geom) as geom from ruian.vusc_g")
while 1:
a = cursorP.fetchmany()
if not a:
break
val = list()
for row in a:
dictionary = dict()
dictionary['1']=row[0]
dictionary['2']=row[1]
dictionary['3']=cx_oracle.Binary(row[2])
val.append(dictionary)
orcl_inserttext = '''INSERT INTO test_Postgres VALUES (:1, :2, SDO_UTIL.FROM_WKBGEOMETRY(:3))'''
cursorO.executemany(orcl_inserttext,val)
Wihout geometry it's OK. But in this case I receive Error ORA-01461: can bind a LONG value only for insert into a LONG column. Psycopg2 gives me WKB like buffer, but i don't know, how to use it in a cx_oracle insert.
In my opinion geometry is to large for this syntaxe inserting of records.
Do you have any idea how do it differently?