<tfoot id='pY8ap'></tfoot>

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

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

          <bdo id='pY8ap'></bdo><ul id='pY8ap'></ul>
        <legend id='pY8ap'><style id='pY8ap'><dir id='pY8ap'><q id='pY8ap'></q></dir></style></legend>

        当我想在比较中使用它们时,我应该如何处理 PL/SQL 存储过程中的空参数?

        How should I deal with null parameters in a PL/SQL stored procedure when I want to use them in comparisons?(当我想在比较中使用它们时,我应该如何处理 PL/SQL 存储过程中的空参数?)
        <i id='FbccL'><tr id='FbccL'><dt id='FbccL'><q id='FbccL'><span id='FbccL'><b id='FbccL'><form id='FbccL'><ins id='FbccL'></ins><ul id='FbccL'></ul><sub id='FbccL'></sub></form><legend id='FbccL'></legend><bdo id='FbccL'><pre id='FbccL'><center id='FbccL'></center></pre></bdo></b><th id='FbccL'></th></span></q></dt></tr></i><div id='FbccL'><tfoot id='FbccL'></tfoot><dl id='FbccL'><fieldset id='FbccL'></fieldset></dl></div>
        <legend id='FbccL'><style id='FbccL'><dir id='FbccL'><q id='FbccL'></q></dir></style></legend>
      1. <small id='FbccL'></small><noframes id='FbccL'>

              <tbody id='FbccL'></tbody>

          • <tfoot id='FbccL'></tfoot>

                  <bdo id='FbccL'></bdo><ul id='FbccL'></ul>
                  本文介绍了当我想在比较中使用它们时,我应该如何处理 PL/SQL 存储过程中的空参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个带有参数 name 的存储过程,我想在 where 子句中使用它来匹配列的值,例如

                  I have a stored procedure with a parameter name which I want to use in a where clause to match the value of a column i.e. something like

                  where col1 = name
                  

                  当然,由于 null 的工作方式,这当然无法将 null 匹配到 null.我需要做吗

                  Now of course this fails to match null to null because of the way null works. Do I need to do

                  where ((name is null and col1 is null) or col1 = name)
                  

                  在这种情况下,或者有更简洁的方法吗?

                  in situations like this or is there a more concise way of doing it?

                  推荐答案

                  您可以使用 decode 功能如下:

                  You can use decode function in the following fashion:

                  where decode(col1, name, 0) is not null
                  

                  从 SQL 参考中引用:

                  Cite from SQL reference:

                  在一个 DECODE 函数中,Oracle 考虑两个 null 是等价的.

                  In a DECODE function, Oracle considers two nulls to be equivalent.

                  这篇关于当我想在比较中使用它们时,我应该如何处理 PL/SQL 存储过程中的空参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  ibtmp1是非压缩的innodb临时表的独立表空间,通过innodb_temp_data_file_path参数指定文件的路径,文件名和大小,默认配置为ibtmp1:12M:autoextend,也就是说在文件系统磁盘足够的情况下,这个文件大小是可以无限增长的。 为了避免ibtmp1文件无止境的暴涨导致
                  SQL query to group by day(按天分组的 SQL 查询)
                  What does SQL clause quot;GROUP BY 1quot; mean?(SQL 子句“GROUP BY 1是什么意思?意思是?)
                  MySQL groupwise MAX() returns unexpected results(MySQL groupwise MAX() 返回意外结果)
                  MySQL SELECT most frequent by group(MySQL SELECT 按组最频繁)
                  Include missing months in Group By query(在 Group By 查询中包含缺失的月份)
                  <tfoot id='THeFA'></tfoot>

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

                            <tbody id='THeFA'></tbody>

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

                            <legend id='THeFA'><style id='THeFA'><dir id='THeFA'><q id='THeFA'></q></dir></style></legend>