<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Calling stored procedure (in Oracle) using ArcSDESQLExecute in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/calling-stored-procedure-in-oracle-using/m-p/213422#M16439</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To resolve this remove the semi-colon in your argument.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;CALL WORKORDERPACKAGE.CreateWorkOrder('20200722','Leak Survey 3 Year','{"Area": "Map 49", "ScheduledStartDate": "12/31/2019", "ScheduledFinishDate": "7/31/2020", "Assignments": ["AllWorkers"], "FieldValues": {"PROJECT_NAME": "0318_TestWO_009", "WorkOrderComment": "", "WorkOrderEquipment": [""]}}',1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Also add a commitTransaction()&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="border: 0px;"&gt;sql_conn = arcpy.ArcSDESQLExecute(&amp;lt;sde connectionfile path&amp;gt;)&lt;/P&gt;&lt;P style="border: 0px;"&gt;&amp;nbsp;&amp;nbsp; sql = 'CALL &amp;lt;packagename&amp;gt;.&amp;lt;procedure name&amp;gt;(&amp;lt;parameters&amp;gt;)'&lt;/P&gt;&lt;P style="border: 0px;"&gt;&amp;nbsp;&amp;nbsp; success = sql_conn.execute(sql)&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;if&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;success:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sql_conn.commitTransaction()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Jul 2020 16:37:21 GMT</pubDate>
    <dc:creator>DaneHopkins</dc:creator>
    <dc:date>2020-07-24T16:37:21Z</dc:date>
    <item>
      <title>Calling stored procedure (in Oracle) using ArcSDESQLExecute</title>
      <link>https://community.esri.com/t5/python-questions/calling-stored-procedure-in-oracle-using/m-p/213421#M16438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, I'm trying to use a python script to make a call to an oracle database via an sde connection file to execute a stored procedure within the database. According to &lt;A _jive_internal="true" href="https://community.esri.com/thread/89483"&gt;this thread&lt;/A&gt; I found it should be possible according to user "cbutler_1", however regardless of my attempts to correctly format the sql statement this is the error I continue to get:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AttributeError: ArcSDESQLExecute: StreamExecute ArcSDE Extended error 911 ORA-00911: invalid character&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is how I'm using the ArcSDESQLExecute method to make the call via the sde connection file:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sql_conn = arcpy.ArcSDESQLExecute(&amp;lt;sde connectionfile path&amp;gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; sql = 'CALL &amp;lt;packagename&amp;gt;.&amp;lt;procedure name&amp;gt;(&amp;lt;parameters&amp;gt;)'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; success = sql_conn.execute(sql)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the the argument that is being passed to the ArcSDESQLExecute method (found via debugging):&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;CALL WORKORDERPACKAGE.CreateWorkOrder('20200722','Leak Survey 3 Year','{"Area": "Map 49", "ScheduledStartDate": "12/31/2019", "ScheduledFinishDate": "7/31/2020", "Assignments": ["AllWorkers"], "FieldValues": {"PROJECT_NAME": "0318_TestWO_009", "WorkOrderComment": "", "WorkOrderEquipment": [""]}}',1);&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;It's worth noting that I can paste the above statement into SQL developer and run it without issue, so I'm wondering if perhaps the error arises in how the statement is being handed off from the ArcSDESQLExecute method through the sde connection&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jul 2020 18:58:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calling-stored-procedure-in-oracle-using/m-p/213421#M16438</guid>
      <dc:creator>StevenCase1</dc:creator>
      <dc:date>2020-07-22T18:58:04Z</dc:date>
    </item>
    <item>
      <title>Re: Calling stored procedure (in Oracle) using ArcSDESQLExecute</title>
      <link>https://community.esri.com/t5/python-questions/calling-stored-procedure-in-oracle-using/m-p/213422#M16439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To resolve this remove the semi-colon in your argument.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;CALL WORKORDERPACKAGE.CreateWorkOrder('20200722','Leak Survey 3 Year','{"Area": "Map 49", "ScheduledStartDate": "12/31/2019", "ScheduledFinishDate": "7/31/2020", "Assignments": ["AllWorkers"], "FieldValues": {"PROJECT_NAME": "0318_TestWO_009", "WorkOrderComment": "", "WorkOrderEquipment": [""]}}',1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Also add a commitTransaction()&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="border: 0px;"&gt;sql_conn = arcpy.ArcSDESQLExecute(&amp;lt;sde connectionfile path&amp;gt;)&lt;/P&gt;&lt;P style="border: 0px;"&gt;&amp;nbsp;&amp;nbsp; sql = 'CALL &amp;lt;packagename&amp;gt;.&amp;lt;procedure name&amp;gt;(&amp;lt;parameters&amp;gt;)'&lt;/P&gt;&lt;P style="border: 0px;"&gt;&amp;nbsp;&amp;nbsp; success = sql_conn.execute(sql)&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;if&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;success:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sql_conn.commitTransaction()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jul 2020 16:37:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calling-stored-procedure-in-oracle-using/m-p/213422#M16439</guid>
      <dc:creator>DaneHopkins</dc:creator>
      <dc:date>2020-07-24T16:37:21Z</dc:date>
    </item>
  </channel>
</rss>

