<?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>Question Re: Resetting a sequence in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/resetting-a-sequence/qaa-p/10565819#M3842764</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I didn't write that it was bad design. I wrote it is a bug &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/1024/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can do it via EXECUTE IMMEDIATE 'ALTER SEQUENCE &amp;lt;seq. name&amp;gt; RESTART WITH &amp;lt;value&amp;gt;'; from within a stored procedure. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it remains a bug.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Lars&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Sep 2014 15:17:20 GMT</pubDate>
    <dc:creator>lbreddemann</dc:creator>
    <dc:date>2014-09-22T15:17:20Z</dc:date>
    <item>
      <title>Resetting a sequence</title>
      <link>https://community.sap.com/t5/technology-q-a/resetting-a-sequence/qaq-p/10565815</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any simple way to reset a HDBSEQUENCE?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose I have a sequence whose range is 1-100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a procedure&amp;nbsp; I need to reset the sequence and use it but for other procedures I need to just use NEXTVAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have seen the syntax of create sequence with RESET BY option, but I want to just reset the sequence to its initial value .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;S.Srivatsan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Sep 2014 13:31:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/resetting-a-sequence/qaq-p/10565815</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-09-18T13:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: Resetting a sequence</title>
      <link>https://community.sap.com/t5/technology-q-a/resetting-a-sequence/qaa-p/10565816#M3842761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ALTER SEQUENCE seq RESTART WITH 1; ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Fernando&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Sep 2014 16:10:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/resetting-a-sequence/qaa-p/10565816#M3842761</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-09-19T16:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: Resetting a sequence</title>
      <link>https://community.sap.com/t5/technology-q-a/resetting-a-sequence/qaa-p/10565817#M3842762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;Srivatsan Sundaravaradan wrote:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;In a procedure&amp;nbsp; I need to reset the sequence and use it but for other procedures I need to just use NEXTVAL.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;That's a design bug in your application.&lt;/P&gt;&lt;P&gt;If you need &lt;EM&gt;&lt;STRONG&gt;independent&lt;/STRONG&gt;&lt;/EM&gt; sequence numbers then use different sequences.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Remember, your code does not have control over the sequence. Any other process might request a new number any time. Resetting it at runtime is plain wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Lars&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2014 14:24:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/resetting-a-sequence/qaa-p/10565817#M3842762</guid>
      <dc:creator>lbreddemann</dc:creator>
      <dc:date>2014-09-22T14:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: Resetting a sequence</title>
      <link>https://community.sap.com/t5/technology-q-a/resetting-a-sequence/qaa-p/10565818#M3842763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi @ Fernando,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Alter Sequence is not supported within the procedure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@ Lars : &lt;/P&gt;&lt;P&gt;I knew it is not a good design but still want to know how to do it...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Srivatsan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2014 15:01:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/resetting-a-sequence/qaa-p/10565818#M3842763</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-09-22T15:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: Resetting a sequence</title>
      <link>https://community.sap.com/t5/technology-q-a/resetting-a-sequence/qaa-p/10565819#M3842764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I didn't write that it was bad design. I wrote it is a bug &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/1024/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can do it via EXECUTE IMMEDIATE 'ALTER SEQUENCE &amp;lt;seq. name&amp;gt; RESTART WITH &amp;lt;value&amp;gt;'; from within a stored procedure. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it remains a bug.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Lars&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2014 15:17:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/resetting-a-sequence/qaa-p/10565819#M3842764</guid>
      <dc:creator>lbreddemann</dc:creator>
      <dc:date>2014-09-22T15:17:20Z</dc:date>
    </item>
  </channel>
</rss>

