<?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: Using sde.version_util.set_current_version in Oracle stored procedure in Geodatabase Questions</title>
    <link>https://community.esri.com/t5/geodatabase-questions/using-sde-version-util-set-current-version-in/m-p/793514#M2255</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Apurv, your answer was very helpful !&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was doing updates and inserts to the featureclass using the stored procedure. I used the actual featureclass instead of using it corresponding view. That is where everything went wrong for me. Though i was doing the edits in an edit version, it was apparently updating the base table as well.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was able to set the version back to SDE.DEFAULT after the updates and it seems working for me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Sep 2018 21:20:11 GMT</pubDate>
    <dc:creator>Uday_BhanuBurrey2</dc:creator>
    <dc:date>2018-09-10T21:20:11Z</dc:date>
    <item>
      <title>Using sde.version_util.set_current_version in Oracle stored procedure</title>
      <link>https://community.esri.com/t5/geodatabase-questions/using-sde-version-util-set-current-version-in/m-p/793511#M2252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to write a stored procedure in Oracle to fetch data from a particular version, by using the&amp;nbsp;sde.version_util.set_current_version function. When I run the following statement individually in SQL Developer, it works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXEC sde.version_util.set_current_version('My Version Name');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It shows a message in SQL Developer as -&amp;gt;&amp;nbsp;anonymous block completed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After this I can query this version to get the data that I want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However when I try to use the same statement in a stored procedure it gives following error -&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Error(12,8): PLS-00103: Encountered the symbol "SDE" when expecting one of the following: := . ( @ % ; The symbol ":=" was substituted for "SDE" to continue.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use EXECUTE IMMEDIATE (as given below) instead of EXEC, then I get a different error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXECUTE IMMEDIATE sde.version_util.set_current_version('My Version Name');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Error(12,21): PLS-00222: no function with name 'SET_CURRENT_VERSION' exists in this scope&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ArcGIS geodatabase is 10.4.1 and database which we're using is Oracle 12g.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone suggest how this function has to be used in a stored procedure?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once this statement gets executed, I want to select some data from versioned view in a cursor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Apurv&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Dec 2017 17:33:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/using-sde-version-util-set-current-version-in/m-p/793511#M2252</guid>
      <dc:creator>ApurvDanke</dc:creator>
      <dc:date>2017-12-20T17:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: Using sde.version_util.set_current_version in Oracle stored procedure</title>
      <link>https://community.esri.com/t5/geodatabase-questions/using-sde-version-util-set-current-version-in/m-p/793512#M2253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Apurv,&lt;/P&gt;&lt;P&gt;Did you get around the prblem?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Aug 2018 18:46:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/using-sde-version-util-set-current-version-in/m-p/793512#M2253</guid>
      <dc:creator>Uday_BhanuBurrey2</dc:creator>
      <dc:date>2018-08-30T18:46:47Z</dc:date>
    </item>
    <item>
      <title>Re: Using sde.version_util.set_current_version in Oracle stored procedure</title>
      <link>https://community.esri.com/t5/geodatabase-questions/using-sde-version-util-set-current-version-in/m-p/793513#M2254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Uday,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before querying the versioned view in my stored procedure I wrote the following statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sde.version_util.set_current_version(Version_Name);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After that I wrote the query to retrieve the data from this version.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lastly you need to set the current version back to SDE.DEFAULT, so you must call the function again after getting the data. For some reason which I cannot recall , I had to do this particular thing in a separate stored procedure which has just one line which is to set the current version.&lt;/P&gt;&lt;P&gt;So I made 2 SP calls - first one containing setting the query version, and executing the query to get the data.&lt;/P&gt;&lt;P&gt;2nd one simply to set the current version back to SDE.DEFAULT. This approach worked for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure if you can write the last statement to set back to SDE.DEFAULT in the same stored procedure, but you can try.&lt;/P&gt;&lt;P&gt;Hope this input helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Apurv&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Aug 2018 10:16:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/using-sde-version-util-set-current-version-in/m-p/793513#M2254</guid>
      <dc:creator>ApurvDanke</dc:creator>
      <dc:date>2018-08-31T10:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using sde.version_util.set_current_version in Oracle stored procedure</title>
      <link>https://community.esri.com/t5/geodatabase-questions/using-sde-version-util-set-current-version-in/m-p/793514#M2255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Apurv, your answer was very helpful !&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was doing updates and inserts to the featureclass using the stored procedure. I used the actual featureclass instead of using it corresponding view. That is where everything went wrong for me. Though i was doing the edits in an edit version, it was apparently updating the base table as well.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was able to set the version back to SDE.DEFAULT after the updates and it seems working for me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Sep 2018 21:20:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/using-sde-version-util-set-current-version-in/m-p/793514#M2255</guid>
      <dc:creator>Uday_BhanuBurrey2</dc:creator>
      <dc:date>2018-09-10T21:20:11Z</dc:date>
    </item>
  </channel>
</rss>

