<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 中继续插入

      时间:2023-11-02
    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 中继续插入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:在 PL/SQL 中并行化调用 下一篇:如何在 PL/SQL 中发送带有表单数据和参数的 POST 请求

                相关文章

                1. <tfoot id='u0xda'></tfoot>

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

                  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'>