1

I'm attempting to execute an Oracle 12c stored procedure using ArcSDESQLExecute:

import arcpy

egdb_conn = arcpy.ArcSDESQLExecute(r"Database Connections\con1.sde")

sql = '''execute update_sle (2500000, 500000)'''
egdb_return = egdb_conn.execute(sql)

print "Complete."

However, I'm getting the following error:

Message File Name   Line    Position    
Traceback               
    <module>    <module1>   21      
    execute C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\arcobjects\arcobjects.py  27      
AttributeError: ArcSDESQLExecute: StreamExecute ArcSDE Extended error 900 ORA-00900: invalid SQL statement              

Question:

How can I execute an Oracle stored procedure by using ArcSDESQLExecute?


Notes:

  1. The python script executes successfully on select queries. Therefore, I know the script works.
  2. I can execute the procedure from SQL Developer successfully. Therefore, I know the procedure works.
  3. I tried SET FEEDBACK OFF but got an error. More info here.
  4. Related question/answer here, but I think it's for SQL Server.
1

As mentioned in this thread, replacing EXECUTE with CALL can resolve this issue - sometimes at least.

This SO response addresses the issue more generally, suggesting it's not peculiar to ArcGIS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.