1. <tfoot id='Nv72B'></tfoot>

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

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

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

      2. 如何在 Oracle PL/SQL where 子句中使用变量

        How to use variables in an Oracle PL/SQL where clause(如何在 Oracle PL/SQL where 子句中使用变量)
          <bdo id='ajh9d'></bdo><ul id='ajh9d'></ul>

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

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

                1. 本文介绍了如何在 Oracle PL/SQL where 子句中使用变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我似乎无法让变量在 Oracle PL/SQL where 子句中工作.我来自 Microsoft SQL Server 背景,这很容易.例如,执行与以下类似的操作所需的所有步骤是什么?

                  I can't seem to get variables to work in an Oracle PL/SQL where clause. I come from a Microsoft SQL Server background and there it was easy. For example, what would be all steps needed to do something similar to the following?

                  declare @var int set @var = 1
                  
                  select * from SomeTable where SomeField = @var
                  

                  这在 PL/SQL 中似乎并不难,但显然确实如此.:-/我听说我需要在 PL/SQL 中使用游标等?

                  This doesn't seem like it should be hard in PL/SQL, but evidently it is. :-/ I hear I need to use cursors and the like in PL/SQL?

                  任何帮助将不胜感激.谢谢.

                  Any help would be greatly appreciated. Thanks.

                  推荐答案

                  您想对 SELECT 返回的数据做什么?如果你只是想看看它,你根本不需要 PL/SQL,只需在 SQL Plus 中执行此操作:

                  What do you want to do with the data that the SELECT returns? If you just want to see it you don't need PL/SQL at all, just do this in SQL Plus:

                  variable var number
                  exec :var := 1
                  
                  select * from SomeTable where SomeField = :var;
                  

                  或者在 SQL Developer 或 Toad 之类的工具中,只需执行以下操作:

                  Or in a tool like SQL Developer or Toad, just do this:

                  select * from SomeTable where SomeField = :var;
                  

                  它会提示你输入 :var 的值.

                  and it will prompt you to enter the value for :var.

                  这篇关于如何在 Oracle PL/SQL where 子句中使用变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  SQL variable to hold list of integers(用于保存整数列表的 SQL 变量)
                  How to call Oracle function or stored procedure using spring persistence framework?(如何使用 Spring 持久化框架调用 Oracle 函数或存储过程?)
                  What can cause intermittent ORA-12519 (TNS: no appropriate handler found) errors(什么会导致间歇性 ORA-12519(TNS:找不到合适的处理程序)错误)
                  SQL to return the number of working days between 2 passed in dates(SQL 返回两个传入日期之间的工作日数)
                  Oracle Date Subtraction(Oracle 日期减法)
                  Is using quot;select *quot; for a cursor in PL/SQL considered bad programming?(正在使用“选择 *PL/SQL 中的游标被认为是糟糕的编程?)

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

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

                        <tbody id='gc91E'></tbody>

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

                        1. <tfoot id='gc91E'></tfoot>