• <small id='KRWJE'></small><noframes id='KRWJE'>

    <tfoot id='KRWJE'></tfoot>

  • <legend id='KRWJE'><style id='KRWJE'><dir id='KRWJE'><q id='KRWJE'></q></dir></style></legend>
        <i id='KRWJE'><tr id='KRWJE'><dt id='KRWJE'><q id='KRWJE'><span id='KRWJE'><b id='KRWJE'><form id='KRWJE'><ins id='KRWJE'></ins><ul id='KRWJE'></ul><sub id='KRWJE'></sub></form><legend id='KRWJE'></legend><bdo id='KRWJE'><pre id='KRWJE'><center id='KRWJE'></center></pre></bdo></b><th id='KRWJE'></th></span></q></dt></tr></i><div id='KRWJE'><tfoot id='KRWJE'></tfoot><dl id='KRWJE'><fieldset id='KRWJE'></fieldset></dl></div>
          <bdo id='KRWJE'></bdo><ul id='KRWJE'></ul>

        oracle 11g 中的重置序列

        Reset Sequence in oracle 11g(oracle 11g 中的重置序列)
        <tfoot id='wUDo2'></tfoot>

            <small id='wUDo2'></small><noframes id='wUDo2'>

                <bdo id='wUDo2'></bdo><ul id='wUDo2'></ul>

              • <legend id='wUDo2'><style id='wUDo2'><dir id='wUDo2'><q id='wUDo2'></q></dir></style></legend>
                  <i id='wUDo2'><tr id='wUDo2'><dt id='wUDo2'><q id='wUDo2'><span id='wUDo2'><b id='wUDo2'><form id='wUDo2'><ins id='wUDo2'></ins><ul id='wUDo2'></ul><sub id='wUDo2'></sub></form><legend id='wUDo2'></legend><bdo id='wUDo2'><pre id='wUDo2'><center id='wUDo2'></center></pre></bdo></b><th id='wUDo2'></th></span></q></dt></tr></i><div id='wUDo2'><tfoot id='wUDo2'></tfoot><dl id='wUDo2'><fieldset id='wUDo2'></fieldset></dl></div>
                    <tbody id='wUDo2'></tbody>
                • 本文介绍了oracle 11g 中的重置序列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试使用 oracle 11g 中的以下过程将序列动态重置为 1.

                  I am trying to reset the sequence to 1 dynamically using the following procedure in oracle 11g.

                  create or replace
                  procedure reset_sequence(p_seq in varchar2)
                  is
                      l_value number;
                  begin
                  
                  -- Select the next value of the sequence
                  
                      execute immediate
                      'select ' || p_seq || 
                      '.nextval from dual' INTO l_value;
                  
                  -- Set a negative increment for the sequence, 
                  -- with value = the current value of the sequence
                  
                      execute immediate
                      'alter sequence ' || p_seq || 
                      ' increment by -' || l_value || ' minvalue 0';
                  
                  -- Select once from the sequence, to 
                  -- take its current value back to 0
                  
                      execute immediate
                      'select ' || p_seq || 
                      '.nextval from dual' INTO l_value;
                  
                  -- Set the increment back to 1
                  
                      execute immediate
                      'alter sequence ' || p_seq || 
                      ' increment by 1 minvalue 0';
                  end;
                  /
                  

                  但是当我尝试执行重置序列circle_seq的过程时,出现以下错误

                  But when I am trying to execute the procedure to reset the sequence circle_seq, I am getting following error

                  BEGIN reset_sequence(vf_circle_seq); END;
                  
                                       *
                  ERROR at line 1:
                  ORA-06550: line 1, column 22:
                  PLS-00357: Table,View Or Sequence reference 'CIRCLE_SEQ' not allowed 
                             in this context
                  ORA-06550: line 1, column 7:
                  PL/SQL: Statement ignored
                  

                  代码有什么问题?这在 oracle 11g 中是不可能的,因为我在 oracle 10g 中使用的相同代码在它工作正常之前.

                  what is wrong in code? is this is not possible in oracle 11g because same code I used in oracle 10g before it worked fine.

                  推荐答案

                  序列名称应以字符串形式传递

                  The sequence name should be passed as a string

                  BEGIN 
                    reset_sequence('vf_circle_seq'); 
                  END;
                  

                  这篇关于oracle 11g 中的重置序列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How to redirect the output of DBMS_OUTPUT.PUT_LINE to a file?(如何将 DBMS_OUTPUT.PUT_LINE 的输出重定向到文件?)
                  How do I get column datatype in Oracle with PL-SQL with low privileges?(如何使用低权限的 PL-SQL 在 Oracle 中获取列数据类型?)
                  Get a list of all functions and procedures in an Oracle database(获取 Oracle 数据库中所有函数和过程的列表)
                  Why cannot I create triggers on objects owned by SYS?(为什么我不能在 SYS 拥有的对象上创建触发器?)
                  Returning result even for elements in IN list that don#39;t exist in table(即使对于表中不存在的 IN 列表中的元素也返回结果)
                  No more data to read from socket(没有更多的数据要从套接字读取)
                  • <tfoot id='drJsV'></tfoot>
                        <tbody id='drJsV'></tbody>

                        <i id='drJsV'><tr id='drJsV'><dt id='drJsV'><q id='drJsV'><span id='drJsV'><b id='drJsV'><form id='drJsV'><ins id='drJsV'></ins><ul id='drJsV'></ul><sub id='drJsV'></sub></form><legend id='drJsV'></legend><bdo id='drJsV'><pre id='drJsV'><center id='drJsV'></center></pre></bdo></b><th id='drJsV'></th></span></q></dt></tr></i><div id='drJsV'><tfoot id='drJsV'></tfoot><dl id='drJsV'><fieldset id='drJsV'></fieldset></dl></div>

                        <small id='drJsV'></small><noframes id='drJsV'>

                            <bdo id='drJsV'></bdo><ul id='drJsV'></ul>
                          • <legend id='drJsV'><style id='drJsV'><dir id='drJsV'><q id='drJsV'></q></dir></style></legend>