<tfoot id='caICO'></tfoot>

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

    2. <small id='caICO'></small><noframes id='caICO'>

      引发异常时在 Oracle 中继续插入

      Continuing Inserts in Oracle when exception is raised(引发异常时在 Oracle 中继续插入)
    3. <legend id='lf1vS'><style id='lf1vS'><dir id='lf1vS'><q id='lf1vS'></q></dir></style></legend>

      1. <small id='lf1vS'></small><noframes id='lf1vS'>

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

                <tbody id='lf1vS'></tbody>
              1. 本文介绍了引发异常时在 Oracle 中继续插入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我正在将数据从旧系统迁移到我们的新应用程序(在 Oracle 数据库 10gR2 上运行).作为迁移的一部分,我正在编写一个脚本,该脚本将数据插入到应用程序使用的表中.

                I'm working on migration of data from a legacy system into our new app(running on Oracle Database, 10gR2). As part of the migration, I'm working on a script which inserts the data into tables that are used by the app.

                导入的数据行数达到数千,源数据不干净(NOT NULL 列中出现意外的空值等).所以在通过脚本插入数据的时候,每当发生这样的异常时,脚本会突然结束,整个事务被回滚.

                The number of rows of data that are imported runs into thousands, and the source data is not clean (unexpected nulls in NOT NULL columns, etc). So while inserting data through the scripts, whenever such an exception occurs, the script ends abruptly, and the whole transaction is rolled back.

                有没有办法可以继续插入行干净的数据?使用 NVL()COALESCE() 不是一种选择,因为我想记录导致错误的行,以便可以在下一次通过时更正数据.

                Is there a way, by which I can continue inserts of data for which the rows are clean? Using NVL() or COALESCE() is not an option, as I'd like to log the rows causing the errors so that the data can be corrected for the next pass.

                我当前的过程有一个异常处理程序,我正在记录导致错误的第一行.插入是否可以继续而不终止,因为现在在第一个处理的异常处,过程终止执行.

                My current procedure has an exception handler, I am logging the first row which causes the error. Would it be possible for inserts to continue without termination, because right now on the first handled exception, the procedure terminates execution.

                推荐答案

                使用 PLSQL,您可以在其自己的事务中执行每个插入(在每个之后提交),并使用持续运行的异常处理程序记录或忽略错误.

                Using PLSQL you can perform each insert in its own transaction (COMMIT after each) and log or ignore errors with an exception handler that keeps going.

                这篇关于引发异常时在 Oracle 中继续插入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                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 列表中的元素也返回结果)
                Reset Sequence in oracle 11g(oracle 11g 中的重置序列)
                1. <tfoot id='u0xda'></tfoot>

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

                          <tbody id='u0xda'></tbody>
                      1. <legend id='u0xda'><style id='u0xda'><dir id='u0xda'><q id='u0xda'></q></dir></style></legend>

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

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