can you inform me about the version of cx_Oracle and Python that i should install that are compatible with the above mentioned softwares?
also what are the steps that i must execute to access Oracle from Python, and use cx_oracle with python ?? is it obligate to install ArcGIS if yes what is the version that I should install??thank you very much.
### Build a DSN (can be subsitited for a TNS name) dsn = cx_Oracle.makedsn("myconn", instance, schema) oradb = cx_Oracle.connect("User", "Password", dsn) cursor = oradb.cursor() _sqlQry = """SELECT table1.Field1, table1.Field2 FROM table1 WHERE table1.Field1 IN (""" + parameter1 + """)"""" cursor.execute(_sqlQry) datArray = [] cxRows = cursor.fetchall() for cxRow in cxRows: datArray.append(cxRow) #close the conn to ora cursor.close() oradb.close() del cxRows, cursor #I also incorporate the Pandas library for doing computations and table operations DF = DataFrame(datArray, columns=['field1', 'field2']) #convert pandas DataFrame result into a numpyarray dfar = DF.to_records() nmpyar = np.array(dfar, np.dtype([('field1', '|S25'), ('field2', '<f8')])) ##now covert the numpyarray to the gdb table in the default.gdb arcpy.da.NumPyArrayToTable(nmpyar, r"H:\Documents\ArcGIS\Default.gdb\numpytab")
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.