AnsweredAssumed Answered

ArcSDESQLexecute error??

Question asked by cliveswan on Dec 23, 2015
Latest reply on Dec 23, 2015 by Dan_Patterson

Greetings,

 

I am trying to get a basic sql statement working using arcpy.ArcSDESQLExecute, it keeps throwing an error.

I need to run an external sql  with joins, etc in .sql file.

 

##The code

import arcpy,sys,csv

 

# Python environment

arcpy.env.overwriteOutput = True

 

workspace = arcpy.env.workspace = r"C:\database_connections\K2_Master_Training.sde"

sde_conn =  arcpy.ArcSDESQLExecute(r"C:\database_connections\K2_Master_Training.sde")

sql = "SELECT * FROM tbSite"

sqlresult = sde_conn.execute(sql)

for i in sqlresult:

    print i

 

Get the following error??

AttributeError: AttributeError(u'ArcSDESQLExecute: SreamBindOutputColumn ArcSDE Error -65 \uec5c',)

 

If would appreciate assistance getting this working, to read a sql file.

 

Thanks,

 

Clive

Outcomes