geoffreywestgis

ArcSDESQLExecute: StreamPrepareSQL ArcSDE Error -38/SQL to Oracle?

Discussion created by geoffreywestgis on Jan 20, 2017
Latest reply on Jan 21, 2017 by bixb0012

I have a Python script that has thrown this error.  The script has remained functional and working properly until I have changed the paths of the data that is being read in it.  Initially the application read 3 different tables which were all in a SQL Server DB.  I made a very small subset of each table(3 records) and exported these tables to an Oracle DB, when I am reading the data from the Oracle environment this error is thrown.  Here is where I make my ArcSDESQLExecute connection. What is the solution for this?

 

ticket_sql = "select {0} from {1} where {2} >= '{3}' and CONVERT(time, {4}) > '{5}' and jobid NOT LIKE '%ZZ%' ".format(self.ticket_id_field, self.ticket_audit_table_name, self.modified_date_field, last_date, self.modified_time_field, last_time)
self.logger.debug(ticket_sql)

conn = arcpy.ArcSDESQLExecute(self.korterra_sde_path)
results = conn.execute(ticket_sql)

Outcomes