<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

        PLSQL :NEW and :OLD(PLSQL :NEW 和 :OLD)
        • <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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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 中的重置序列)
                        <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>

                              <tbody id='Q912H'></tbody>