• <legend id='tBprh'><style id='tBprh'><dir id='tBprh'><q id='tBprh'></q></dir></style></legend>
    <tfoot id='tBprh'></tfoot>
  • <small id='tBprh'></small><noframes id='tBprh'>

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

        • <bdo id='tBprh'></bdo><ul id='tBprh'></ul>
      1. 是否可以使用“返回"?在存储过程中?

        Is it possible to use quot;returnquot; in stored procedure?(是否可以使用“返回?在存储过程中?)

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

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

              <tfoot id='kS1xb'></tfoot>
                <tbody id='kS1xb'></tbody>

                  <bdo id='kS1xb'></bdo><ul id='kS1xb'></ul>
                • 本文介绍了是否可以使用“返回"?在存储过程中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                   CREATE PROCEDURE Pname(in_Tid IN VARCHAR2,in_IP IN VARCHAR2,outstaticip OUT VARCHAR2,outcount OUT NUMBER)
                   AS
                   BEGIN
                   select STATIC_IP into outstaticip from OP_TTER_MAPPING where TERMINAL_ID = in_Tid;
                   if in_IP = outstaticip then
                   return 1;
                   else
                   select COUNT(*) into outcount from OP_TTER_MAPPING where DYNAMIC_IP_LOW <= in_IP AND   DYNAMIC_IP_HIGH >= in_IP AND TERMINAL_ID = in_Tid;
                   if outcount = 1 then
                   return 1;
                   else
                   return 0;
                    end if;
                   end if;
                   END;
                  

                  1. 可以像上面那样在存储过程中使用 return 吗?
                  2. 如果我们可以使用 return,我如何在 Executesql("begin Pname(----)END") 方法中获取返回值
                  1. Is it possible to use return in stored procedure like above?
                  2. If we can use return, how can i get that return value in Executesql("begin Pname(----)END") method

                  编辑

                  现在我像这样在存储过程中编辑了我的返回值,我做对了吗?

                  Now I edited my return value in stored procedure like this, am I doing it right ?

                  CREATE PROCEDURE P_ValidateTIDIP(in_Tid IN VARCHAR2,in_IP IN VARCHAR2,outstaticip OUT VARCHAR2,outcount OUT NUMBER,outretvalue OUT NUMBER)
                  AS
                  BEGIN
                  select STATIC_IP into outstaticip from OP_TTER_MAPPING where TERMINAL_ID = in_Tid;
                  if in_IP = outstaticip then
                      outretvalue:=1;
                  else 
                      select COUNT(*) into outcount from OP_TTER_MAPPING where DYNAMIC_IP_LOW <= in_IP AND DYNAMIC_IP_HIGH >= in_IP AND TERMINAL_ID = in_Tid;
                      if outcount = 1 then 
                       outretvalue:=1;
                      else
                       outretvalue:=0;
                     end if;
                  end if;
                  END;
                  

                  推荐答案

                  在存储过程中,您使用 OUT 参数 ONLY 返回值.正如您在示例中定义了两个变量:

                  In Stored procedure, you return the values using OUT parameter ONLY. As you have defined two variables in your example:

                     outstaticip OUT VARCHAR2, outcount OUT NUMBER
                  

                  只需将返回值分配给输出参数,即 outstaticipoutcount 并从调用位置返回它们.我的意思是:当您调用存储过程时,您也将传递这两个变量.存储过程调用后,变量将填充返回值.

                  Just assign the return values to the out parameters i.e. outstaticip and outcount and access them back from calling location. What I mean here is: when you call the stored procedure, you will be passing those two variables as well. After the stored procedure call, the variables will be populated with return values.

                  如果您希望 RETURN value 作为 PL/SQL 调用的返回值,则使用 FUNCTION.请注意,万一您只能返回一个变量作为返回变量.

                  If you want to have RETURN value as return from the PL/SQL call, then use FUNCTION. Please note that in case, you would be able to return only one variable as return variable.

                  这篇关于是否可以使用“返回"?在存储过程中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Accessing another user#39;s table within an Oracle Stored Procedure(在 Oracle 存储过程中访问另一个用户的表)
                  How to View Oracle Stored Procedure using SQLPlus?(如何使用 SQLPlus 查看 Oracle 存储过程?)
                  How to Pass Java List of Objects to Oracle Stored Procedure Using MyBatis?(如何使用 MyBatis 将 Java 对象列表传递给 Oracle 存储过程?)
                  What is dynamic SQL?(什么是动态 SQL?)
                  Mysql - How to quit/exit from stored procedure(Mysql - 如何退出/退出存储过程)
                  How to find a text inside SQL Server procedures / triggers?(如何在 SQL Server 程序/触发器中查找文本?)

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

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

                            <tbody id='Dl02G'></tbody>

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