AnsweredAssumed Answered

arcpy.ArcSDESQLExecute(sde) problem

Question asked by cam58953 on Oct 10, 2013
Latest reply on Oct 10, 2013 by cam58953
So I've written up this script to print out any alias names of feature classes in all the schemas of our DEV database. However, there's something wrong with my query statement I'm guessing because I get an encoding error back.

This is the error message: ArcSDESQLExecute: SreamBindOutputColumn ArcSDE Error -65 ???

import arcpy,sys try:     arcpy.env.workspace = r'C:\staging\database connections\dev'     sdes = arcpy.ListWorkspaces()     for sde in sdes:         arcpy.env.workspace = sde         first = raw_input("Do you want to update aliases in "+str(sde)+"...\n(Yes/No)\n")         if first.upper() == 'YES':             fcs = arcpy.ListFeatureClasses()             for fc in fcs:                 sde_conn = arcpy.ArcSDESQLExecute(sde)                 sql_stmt = "select Definition.value('(/DEFeatureClassInfo/Name/node())[1]', 'nvarchar(max)') AS Name, Definition.value('(/DEFeatureClassInfo/AliasName/node())[1]', 'nvarchar(max)') AS Alias from agdc_sde.sde.gdb_items where Name = '"+str(fc)+"'"                 sde_return = sde_conn.execute(sql_stmt)                 if sde_return == True:                     print "SQL statement: {0} ran successfully.".format(sql)                 else:                     print "SQL statement: {0} FAILED.".format(sql)                 print "+++++++++++++++++++++++++++++++++++++++++++++\n" except Exception as err:     print unicode(err)     sde_return = False

Outcomes