I'm building a geoprocessing service that queries an SDE database (running on postgres) and returns results. I do a lot of development by calling the script from a toolbox in ArcGIS desktop 10.3.
For some reason when I call the script below in ArcGIS desktop, it executes successfully the first time, then fails every time after that with 'NoneType' object is not callableon line 12 as I try to iterate over inAllCornerPointsList. If I close ArcMap and call it, it works the first time, then fails.
import psycopg2conn = psycopg2.connect(host='localhost', database ='sde', user='sde', password='somepassword')curs = conn.cursor()sqlStatement = """SELECT * FROM sde.gly_ula_corners"""curs.execute(sqlStatement)inAllCornerPointsList = curs.fetchall()for cornerPoint in inAllCornerPointsList: print cornerPointcurs.close()conn.close()print 'Complete'To further confuse things, if I select * from a different table (sde.countyboundaries), my script executes successfully every time.
Any idea what might be causing this? Is there some weird memory environment at work? Calling the script multiple times from the command line or pythonwin does not fail.
أكثر...
For some reason when I call the script below in ArcGIS desktop, it executes successfully the first time, then fails every time after that with 'NoneType' object is not callableon line 12 as I try to iterate over inAllCornerPointsList. If I close ArcMap and call it, it works the first time, then fails.
import psycopg2conn = psycopg2.connect(host='localhost', database ='sde', user='sde', password='somepassword')curs = conn.cursor()sqlStatement = """SELECT * FROM sde.gly_ula_corners"""curs.execute(sqlStatement)inAllCornerPointsList = curs.fetchall()for cornerPoint in inAllCornerPointsList: print cornerPointcurs.close()conn.close()print 'Complete'To further confuse things, if I select * from a different table (sde.countyboundaries), my script executes successfully every time.
Any idea what might be causing this? Is there some weird memory environment at work? Calling the script multiple times from the command line or pythonwin does not fail.
أكثر...