<tfoot id='dd5M9'></tfoot>

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

    • <bdo id='dd5M9'></bdo><ul id='dd5M9'></ul>

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

    1. PL/SQL 中受 UPDATE 影响的行数

      时间:2023-09-18

            <bdo id='nMAHz'></bdo><ul id='nMAHz'></ul>
            <legend id='nMAHz'><style id='nMAHz'><dir id='nMAHz'><q id='nMAHz'></q></dir></style></legend>
          • <small id='nMAHz'></small><noframes id='nMAHz'>

                <i id='nMAHz'><tr id='nMAHz'><dt id='nMAHz'><q id='nMAHz'><span id='nMAHz'><b id='nMAHz'><form id='nMAHz'><ins id='nMAHz'></ins><ul id='nMAHz'></ul><sub id='nMAHz'></sub></form><legend id='nMAHz'></legend><bdo id='nMAHz'><pre id='nMAHz'><center id='nMAHz'></center></pre></bdo></b><th id='nMAHz'></th></span></q></dt></tr></i><div id='nMAHz'><tfoot id='nMAHz'></tfoot><dl id='nMAHz'><fieldset id='nMAHz'></fieldset></dl></div>
                <tfoot id='nMAHz'></tfoot>
                  <tbody id='nMAHz'></tbody>
                本文介绍了PL/SQL 中受 UPDATE 影响的行数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我有一个 PL/SQL 函数(在 Oracle 10g 上运行),我在其中更新了一些行.有没有办法找出受 UPDATE 影响的行数?手动执行查询时,它告诉我有多少行受到影响,我想在 PL/SQL 中获取该数字.

                I have a PL/SQL function (running on Oracle 10g) in which I update some rows. Is there a way to find out how many rows were affected by the UPDATE? When executing the query manually it tells me how many rows were affected, I want to get that number in PL/SQL.

                推荐答案

                您使用 sql%rowcount 变量.

                您需要在需要查找受影响行数的语句之后直接调用它.

                You need to call it straight after the statement which you need to find the affected row count for.

                例如:

                set serveroutput ON; 
                DECLARE 
                    i NUMBER; 
                BEGIN 
                    UPDATE employees 
                    SET    status = 'fired' 
                    WHERE  name LIKE '%Bloggs'; 
                    i := SQL%rowcount; 
                    --note that assignment has to precede COMMIT
                    COMMIT; 
                    dbms_output.Put_line(i); 
                END; 
                

                这篇关于PL/SQL 中受 UPDATE 影响的行数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:Oracle PL/SQL - 如何创建一个简单的数组变量? 下一篇:Oracle SQL 中的自定义顺序

                相关文章

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

                <legend id='XWW5V'><style id='XWW5V'><dir id='XWW5V'><q id='XWW5V'></q></dir></style></legend>
                1. <tfoot id='XWW5V'></tfoot>

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

                    • <bdo id='XWW5V'></bdo><ul id='XWW5V'></ul>