<?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 which will show records of a feature class based on versioned view (from a specific child version in traditional versioning) in Geodatabase Questions</title>
    <link>https://community.esri.com/t5/geodatabase-questions/create-database-view-which-will-show-records-of-a/m-p/1510378#M9186</link>
    <description>&lt;P&gt;If I understand you correctly - you tried to set the version as part of the view definition.&lt;BR /&gt;That's not what I meant.&lt;BR /&gt;Just create the new view in a SQL client (not using Pro GP tool) using something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="sql"&gt;CREATE VIEW new_view AS
SELECT *
FROM your_table_EV
WHERE some_condition;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once your new view is created, then use the set_version command before running a query against your view&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 26 Jul 2024 01:49:17 GMT</pubDate>
    <dc:creator>DavidHoy</dc:creator>
    <dc:date>2024-07-26T01:49:17Z</dc:date>
    <item>
      <title>Create database view which will show records of a feature class based on versioned view (from a specific child version in traditional versioning)</title>
      <link>https://community.esri.com/t5/geodatabase-questions/create-database-view-which-will-show-records-of-a/m-p/1509717#M9175</link>
      <description>&lt;P&gt;Hello Community,&lt;/P&gt;&lt;P&gt;I am searching for a way, so that I can create a database view which would dynamically update the records based on versioned view , however I would require to check those for a specific child version (as the edits are performed in child version).&lt;/P&gt;&lt;P&gt;I came across the following article (&amp;nbsp;&lt;A href="https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/read-sqlserver-versioned-data-with-sql.htm" target="_blank"&gt;https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/read-sqlserver-versioned-data-with-sql.htm&lt;/A&gt;) which mentions from SQL Server we can set the session to a particular child version and then run select statement to check the records within a particular feature class, however am unable to figure out how to create a database view out of this.&lt;/P&gt;&lt;P&gt;I would like to not perform reconcile/post and compress operation for updating the view as this would be a tedious task for our organization.&lt;/P&gt;&lt;P&gt;Any kind of help would be highly appreciated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2024 03:58:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/create-database-view-which-will-show-records-of-a/m-p/1509717#M9175</guid>
      <dc:creator>ZeusThompson</dc:creator>
      <dc:date>2024-07-25T03:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: Create database view which will show records of a feature class based on versioned view (from a specific child version in traditional versioning)</title>
      <link>https://community.esri.com/t5/geodatabase-questions/create-database-view-which-will-show-records-of-a/m-p/1509724#M9176</link>
      <description>&lt;P&gt;if you read that article carefully, you will see the example :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="sql"&gt;SELECT id, species, reporter
FROM sightings_ev
WHERE reporter = 'chuck';&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the clue here is that the FROM clause is using the "Versioned View" that is already created in the geodatabase for any versioned class.&lt;BR /&gt;&lt;BR /&gt;SO, you don't need to create a view - it should be there already. It will be named &lt;STRONG&gt;&amp;lt;featureclassname&amp;gt;_ev&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;If you want to use this _ev in your own view of a view - that should work (but won't be very fast and you won't be able to edit that view of a versioned view).&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2024 04:52:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/create-database-view-which-will-show-records-of-a/m-p/1509724#M9176</guid>
      <dc:creator>DavidHoy</dc:creator>
      <dc:date>2024-07-25T04:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: Create database view which will show records of a feature class based on versioned view (from a specific child version in traditional versioning)</title>
      <link>https://community.esri.com/t5/geodatabase-questions/create-database-view-which-will-show-records-of-a/m-p/1509727#M9177</link>
      <description>&lt;P&gt;Thank you for the suggestion David!&lt;/P&gt;&lt;P&gt;If the select statement is issued against versioned view it does show records, but as per my understanding it would do for the default version.&amp;nbsp; As per my organizations' requirement I need to filter out the records from a specific child version. In SQL Server, we can set the version&amp;nbsp; using following query&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;EXEC&lt;/SPAN&gt; &lt;SPAN class=""&gt;sde&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;set_current_version&lt;/SPAN&gt; &lt;SPAN class=""&gt;' child_version'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;And then issue SELECT statement which would shows records present specifically in the child version. But how should I frame a database view out of that (which would show compartmentalized records from child version )&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2024 05:16:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/create-database-view-which-will-show-records-of-a/m-p/1509727#M9177</guid>
      <dc:creator>ZeusThompson</dc:creator>
      <dc:date>2024-07-25T05:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: Create database view which will show records of a feature class based on versioned view (from a specific child version in traditional versioning)</title>
      <link>https://community.esri.com/t5/geodatabase-questions/create-database-view-which-will-show-records-of-a/m-p/1509733#M9178</link>
      <description>&lt;P&gt;if you create a view that includes the _ev versioned view you don't define which version you are accessing in the view definition (as you say, without further action it will return records from the "DEFAULT" version)&lt;BR /&gt;But, if you want to retrieve records from some other version, you need to run the&amp;nbsp;&lt;BR /&gt;&lt;SPAN class=""&gt;EXEC&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;sde&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;set_current_version&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;' child_version'&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;This will mean &lt;U&gt;all&lt;/U&gt; queries (in that session) after you have run that set_current_version will retrieve from the version requested. That includes the SELECT statements on the versioned view that are part of your view definition&lt;BR /&gt;&lt;BR /&gt;So, your view of a view will do what I think you want, but you will need to set the version as an initial step in your SQL Script before you run SELECT statements against the "view of a view".&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2024 05:54:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/create-database-view-which-will-show-records-of-a/m-p/1509733#M9178</guid>
      <dc:creator>DavidHoy</dc:creator>
      <dc:date>2024-07-25T05:54:10Z</dc:date>
    </item>
    <item>
      <title>Re: Create database view which will show records of a feature class based on versioned view (from a specific child version in traditional versioning)</title>
      <link>https://community.esri.com/t5/geodatabase-questions/create-database-view-which-will-show-records-of-a/m-p/1510084#M9182</link>
      <description>&lt;P&gt;Thank you!!&lt;/P&gt;&lt;P&gt;While creating the view setting the child version workspace and then mentioning the SELECT statement is throwing a syntax error while using "Create Database View" from ArcGIS Pro&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2024 15:28:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/create-database-view-which-will-show-records-of-a/m-p/1510084#M9182</guid>
      <dc:creator>ZeusThompson</dc:creator>
      <dc:date>2024-07-25T15:28:50Z</dc:date>
    </item>
    <item>
      <title>Re: Create database view which will show records of a feature class based on versioned view (from a specific child version in traditional versioning)</title>
      <link>https://community.esri.com/t5/geodatabase-questions/create-database-view-which-will-show-records-of-a/m-p/1510378#M9186</link>
      <description>&lt;P&gt;If I understand you correctly - you tried to set the version as part of the view definition.&lt;BR /&gt;That's not what I meant.&lt;BR /&gt;Just create the new view in a SQL client (not using Pro GP tool) using something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="sql"&gt;CREATE VIEW new_view AS
SELECT *
FROM your_table_EV
WHERE some_condition;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once your new view is created, then use the set_version command before running a query against your view&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2024 01:49:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/create-database-view-which-will-show-records-of-a/m-p/1510378#M9186</guid>
      <dc:creator>DavidHoy</dc:creator>
      <dc:date>2024-07-26T01:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: Create database view which will show records of a feature class based on versioned view (from a specific child version in traditional versioning)</title>
      <link>https://community.esri.com/t5/geodatabase-questions/create-database-view-which-will-show-records-of-a/m-p/1512431#M9192</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/817520"&gt;@ZeusThompson&lt;/a&gt;, what is your goal? Are you just trying to get the rows for a version for yourself? Or are you trying to create a view for use by an application or end users who might not have a sql tool? Is it is the version that you want to query always going to have the same name?&lt;BR /&gt;&lt;BR /&gt;If it is just for you I would do as&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/9873"&gt;@DavidHoy&lt;/a&gt;&amp;nbsp; suggested. If you are trying to create something more user friendly you could use python with sql or an oracle stored procedure.&lt;/P&gt;&lt;P&gt;Oracle:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/geodatabase-questions/using-sde-version-util-set-current-version-in/td-p/793511" target="_blank" rel="noopener"&gt;https://community.esri.com/t5/geodatabase-questions/using-sde-version-util-set-current-version-in/td-p/793511&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Python:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# use cx_orcale to create cusror 
cursor.callproc('sde.version_util.set_current_version', [version])
rows = cursor.execute(version_sql).fetchall()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2024 17:59:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/create-database-view-which-will-show-records-of-a/m-p/1512431#M9192</guid>
      <dc:creator>forestknutsen1</dc:creator>
      <dc:date>2024-07-31T17:59:04Z</dc:date>
    </item>
  </channel>
</rss>

