<?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: How to query a versioned view in PL/SQL Developer? in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/how-to-query-a-versioned-view-in-pl-sql-developer/m-p/649982#M36801</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;7.&amp;nbsp; Open a SQL window and run the command EXEC sde.version_util.set_current_version('MY_VERSION')&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -This is when I get an error ORA-00900: Invalid SQL Statement.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -A coworker recommended trying to run this command in the PL/SQL command window as the following:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BEGIN &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EXEC sde.version_util.set_current_version('MY_VERSION')&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; END;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -But then I couldn't figure out how to run the select statement &lt;STRONG&gt;and see a returned record.&lt;/STRONG&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Have you tried including the SELECT statement inside the same BEGIN/END block? What do you mean with the bold text, I understand you want to export to CSV. I must admit I am less familiar with PL/SQL, but I guess there may be commands for that. Just Googling on "pl/sql export to csv" turns up a whole bunch of code samples you may find useful...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Sep 2013 18:44:46 GMT</pubDate>
    <dc:creator>MarcoBoeringa</dc:creator>
    <dc:date>2013-09-12T18:44:46Z</dc:date>
    <item>
      <title>How to query a versioned view in PL/SQL Developer?</title>
      <link>https://community.esri.com/t5/data-management-questions/how-to-query-a-versioned-view-in-pl-sql-developer/m-p/649980#M36799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm having trouble getting a SELECT query in PL/SQL to actually return records from a version in my Oracle SDE. I tried with a query layer too but I just can't seem to get the &lt;/SPAN&gt;&lt;SPAN style="color:&amp;quot;#0000CD&amp;quot;;"&gt;&lt;STRONG&gt;EXEC sde.version_util.set_current_version('')&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt; command to work. I'm using a 10.1 SP1 client. My test SDE database is 10.2&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's how to recreate my little test environment:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. In ArcCatalog, create a new point feature class on the SDE named 'MY_FC'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Version the feature class&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. Right click on the feature class, then click Manage, and then Create Versioned View. This created a view named MY_FC_VW&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4. Create a geodatabase version on the SDE named 'MY_VERSION'. It will be a child of the default version&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;5. Open ArcMap, add the feature class, point it to the version, and add one point to it, then save edits and stop editing&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So now the goal is to run a query from PL/SQL that will return that new point record while it is in that child version, and this is where I get lost. I'm using the ESRI help as a guide (&lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#/in_Oracle/006z0000000v000000/" rel="nofollow"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#/in_Oracle/006z0000000v000000/&lt;/A&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;6. Open PL/SQL and connect to the database&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;7. Open a SQL window and run the command EXEC sde.version_util.set_current_version('MY_VERSION')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; -This is when I get an error ORA-00900: Invalid SQL Statement.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; -A coworker recommended trying to run this command in the PL/SQL command window as the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; BEGIN &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; EXEC sde.version_util.set_current_version('MY_VERSION')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; END;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; -But then I couldn't figure out how to run the select statement and see a returned record.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyone have any ideas? I ultimately just need to run a query external of ArcGIS that returns all the records in a feature class for a particular version in the geodatabase, and then extract those records to a csv file.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Sep 2013 15:39:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/how-to-query-a-versioned-view-in-pl-sql-developer/m-p/649980#M36799</guid>
      <dc:creator>AndrewRudin</dc:creator>
      <dc:date>2013-09-12T15:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to query a versioned view in PL/SQL Developer?</title>
      <link>https://community.esri.com/t5/data-management-questions/how-to-query-a-versioned-view-in-pl-sql-developer/m-p/649981#M36800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;STRONG&gt;I'm using a 10.1 SP1 client.&amp;nbsp; My test SDE database is 10.2&lt;/STRONG&gt;&lt;BR /&gt;...&lt;BR /&gt;Anyone have any ideas?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Your problem may be here. While ArcMap 10.2 can connect to SDE geodatabases of a lower version, as it is backward compatible with most versions of SDE geodatabases still around, I am pretty sure a 10.1 client is not guaranteed to connect to a 10.2 successfully. Your asking for forward compatibility here...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would recommend you to upgrade your ArcGIS for Desktop client to 10.2 and try again.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;BTW, as of 10.1, versioned views should be automatically created each time you enable versioning on data, so there is no need for step 3 in your description. See this Help text from the link you gave:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;"Beginning with ArcGIS 10.1, versioned views are created when you version data. If your data was versioned prior to 10.1, you can create a versioned view by running the Create Versioned View geoprocessing tool."&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Sep 2013 18:27:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/how-to-query-a-versioned-view-in-pl-sql-developer/m-p/649981#M36800</guid>
      <dc:creator>MarcoBoeringa</dc:creator>
      <dc:date>2013-09-12T18:27:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to query a versioned view in PL/SQL Developer?</title>
      <link>https://community.esri.com/t5/data-management-questions/how-to-query-a-versioned-view-in-pl-sql-developer/m-p/649982#M36801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;7.&amp;nbsp; Open a SQL window and run the command EXEC sde.version_util.set_current_version('MY_VERSION')&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -This is when I get an error ORA-00900: Invalid SQL Statement.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -A coworker recommended trying to run this command in the PL/SQL command window as the following:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BEGIN &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EXEC sde.version_util.set_current_version('MY_VERSION')&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; END;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -But then I couldn't figure out how to run the select statement &lt;STRONG&gt;and see a returned record.&lt;/STRONG&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Have you tried including the SELECT statement inside the same BEGIN/END block? What do you mean with the bold text, I understand you want to export to CSV. I must admit I am less familiar with PL/SQL, but I guess there may be commands for that. Just Googling on "pl/sql export to csv" turns up a whole bunch of code samples you may find useful...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Sep 2013 18:44:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/how-to-query-a-versioned-view-in-pl-sql-developer/m-p/649982#M36801</guid>
      <dc:creator>MarcoBoeringa</dc:creator>
      <dc:date>2013-09-12T18:44:46Z</dc:date>
    </item>
  </channel>
</rss>

