AnsweredAssumed Answered

Arcpy error : Object: Could not open SDE workspace

Question asked by DEVAPPGIS on Jun 7, 2016
Latest reply on Jun 10, 2016 by DEVAPPGIS

Hi at all,

i have develop a python script that execute a query to table into sde connection (DB Oracle).

This my code:

import arcpy
from arcpy import env

env.workspace = ("Database Connections/TEST.sde")
sdeConn = arcpy.ArcSDESQLExecute("Database Connections/TEST.sde")
value = 'V'

sql = "select * from TEST.CATEGORIES WHERE TIP_SER = " + value
    sdeReturn = sdeConn.execute(sql)
except Exception, ErrorDesc:
    print ErrorDesc
    sdeReturn = False


But when i run i recive this error: RuntimeError: Object: Could not open SDE workspace

The sde connection works fine into ArcMap and also i have try other simple connection by arcpy for print a list table and works fine.

So why this error?

Any help?