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

  • <small id='0t8sM'></small><noframes id='0t8sM'>

      1. <legend id='0t8sM'><style id='0t8sM'><dir id='0t8sM'><q id='0t8sM'></q></dir></style></legend>

        <tfoot id='0t8sM'></tfoot>

        PLSQL :NEW 和 :OLD

        时间:2023-11-02
        • <legend id='oOYd2'><style id='oOYd2'><dir id='oOYd2'><q id='oOYd2'></q></dir></style></legend>
            <bdo id='oOYd2'></bdo><ul id='oOYd2'></ul>

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

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

                    <tbody id='oOYd2'></tbody>

                1. 本文介绍了PLSQL :NEW 和 :OLD的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  谁能帮助我理解何时在 PLSQL 块中使用 :NEW:OLD,我发现很难理解它们的用法.

                  Can anyone help me understand when to use :NEW and :OLD in PLSQL blocks, I'm finding it very difficult to understand their usage.

                  推荐答案

                  您通常在 trigger 使用 :old 引用旧值和 :new 引用新值.

                  You normally use the terms in a trigger using :old to reference the old value and :new to reference the new value.

                  这里是上面链接的 Oracle 文档中的一个示例

                  Here is an example from the Oracle documentation linked to above

                  CREATE OR REPLACE TRIGGER Print_salary_changes
                    BEFORE DELETE OR INSERT OR UPDATE ON Emp_tab
                    FOR EACH ROW
                  WHEN (new.Empno > 0)
                  DECLARE
                      sal_diff number;
                  BEGIN
                      sal_diff  := :new.sal  - :old.sal;
                      dbms_output.put('Old salary: ' || :old.sal);
                      dbms_output.put('  New salary: ' || :new.sal);
                      dbms_output.put_line('  Difference ' || sal_diff);
                  END;
                  

                  在这个例子中,触发器触发 BEFORE DELETE OR INSERT OR UPDATE :old.sal 将包含触发器触发之前的薪水和 :new.sal 将包含新值.

                  In this example the trigger fires BEFORE DELETE OR INSERT OR UPDATE :old.sal will contain the salary prior to the trigger firing and :new.sal will contain the new value.

                  这篇关于PLSQL :NEW 和 :OLD的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:在一个过程中调用另一个 PL/SQL 过程 下一篇:Oracle PL/SQL 字符串比较问题

                  相关文章

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

                      <legend id='Q912H'><style id='Q912H'><dir id='Q912H'><q id='Q912H'></q></dir></style></legend>
                      <tfoot id='Q912H'></tfoot>

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