<?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: Create database view using IWorkspace.ExecuteSQL? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/create-database-view-using-iworkspace-executesql/m-p/1215037#M20521</link>
    <description>&lt;P&gt;Thanks, I was hoping to do everything with ArcObjects, without installing other libraries.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Sep 2022 12:45:48 GMT</pubDate>
    <dc:creator>bojko108</dc:creator>
    <dc:date>2022-09-22T12:45:48Z</dc:date>
    <item>
      <title>Create database view using IWorkspace.ExecuteSQL?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/create-database-view-using-iworkspace-executesql/m-p/1214711#M20518</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I'm trying to find a way to run SQL statements using ArcObjects from a standalone application. My idea is to create a materialized view in an oracle database, read data from that view, make some calculations and then to export the results to another table. Currently I'm creating the materialized view manually&amp;nbsp; using SQL Developer IDE, before executing the standalone application which will do the rest of the work. I was wondering if it's possible to create the materialized view from the standalone application - using ArcObjects or something else?&lt;/P&gt;&lt;P&gt;My SQL looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="sql"&gt;DROP MATERIALIZED VIEW MV_GIS_SUBAREAS;

CREATE MATERIALIZED VIEW MV_GIS_SUBAREAS
REFRESH ON DEMAND AS 
SELECT * FROM GDIM.GIS_SUBAREAS;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried to use &lt;STRONG&gt;IWorkspace.ExecuteSQL()&lt;/STRONG&gt;,&amp;nbsp;but seems I'm not using it correctly, or the SQL statement, that I'm trying to run, is not supported:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;string sql = "[ABOVE SQL]";
IWorkspace workspace = Helpers.GetSourceWorkspace();
workspace.ExecuteSQL(sql);&lt;/LI-CODE&gt;&lt;P&gt;I receive the following exception when I run the above code:&amp;nbsp;&lt;STRONG&gt;Underlying DBMS error [ORA-00933: SQL command not properly ended]&lt;/STRONG&gt;. I've tried splitting the SQL statements into a separate calls: first dropping the view then creating it, but again in the first call to the ExecuteSQL() it throws the same exception.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using ArcGIS 10.8.1 and Oracle 19c.&lt;/P&gt;&lt;P&gt;Thanks, Bogdan&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2022 17:19:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/create-database-view-using-iworkspace-executesql/m-p/1214711#M20518</guid>
      <dc:creator>bojko108</dc:creator>
      <dc:date>2022-09-21T17:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: Create database view using IWorkspace.ExecuteSQL?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/create-database-view-using-iworkspace-executesql/m-p/1214787#M20519</link>
      <description>&lt;P&gt;I recommend using C# directly.&lt;/P&gt;&lt;P&gt;First, download and install ODP from this site&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://www.oracle.com/technetwork/topics/dotnet/index-085163.html" target="_blank" rel="noopener noreferrer"&gt;http://www.oracle.com/technetwork/topics/dotnet/index-085163.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;After the installation, add a reference to the assembly&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Oracle.DataAccess.dll&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;You should be able to do everything in c# now without ESRI in the middle.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Brent Hoskisson&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2022 19:32:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/create-database-view-using-iworkspace-executesql/m-p/1214787#M20519</guid>
      <dc:creator>BrentHoskisson</dc:creator>
      <dc:date>2022-09-21T19:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: Create database view using IWorkspace.ExecuteSQL?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/create-database-view-using-iworkspace-executesql/m-p/1214925#M20520</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Have you tried to split sql statements to few ExecuteSQL parts and do not use ';' at the end of part?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2022 05:18:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/create-database-view-using-iworkspace-executesql/m-p/1214925#M20520</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2022-09-22T05:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: Create database view using IWorkspace.ExecuteSQL?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/create-database-view-using-iworkspace-executesql/m-p/1215037#M20521</link>
      <description>&lt;P&gt;Thanks, I was hoping to do everything with ArcObjects, without installing other libraries.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2022 12:45:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/create-database-view-using-iworkspace-executesql/m-p/1215037#M20521</guid>
      <dc:creator>bojko108</dc:creator>
      <dc:date>2022-09-22T12:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: Create database view using IWorkspace.ExecuteSQL?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/create-database-view-using-iworkspace-executesql/m-p/1215040#M20522</link>
      <description>&lt;P&gt;Thank you :), I've already tried splitting the SQL into separate statements, but didn't remove the semicolon at the end. After I removed it the logic works as expected, without throwing exceptions. Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2022 12:48:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/create-database-view-using-iworkspace-executesql/m-p/1215040#M20522</guid>
      <dc:creator>bojko108</dc:creator>
      <dc:date>2022-09-22T12:48:41Z</dc:date>
    </item>
  </channel>
</rss>

