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

      <small id='4iJrP'></small><noframes id='4iJrP'>

        有没有办法在 Oracle 中刷新 PL/SQL 的输出?

        Is there any way to flush output from PL/SQL in Oracle?(有没有办法在 Oracle 中刷新 PL/SQL 的输出?)

          <tfoot id='Tu7Fu'></tfoot>

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

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

                • <bdo id='Tu7Fu'></bdo><ul id='Tu7Fu'></ul>
                  本文介绍了有没有办法在 Oracle 中刷新 PL/SQL 的输出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个从 shell 脚本中调用的 SQL 脚本,需要很长时间才能运行.它目前在各个点包含 dbms_output.put_line 语句.这些打印语句的输出会出现在日志文件中,但仅在脚本完成后才会出现.

                  I have an SQL script that is called from within a shell script and takes a long time to run. It currently contains dbms_output.put_line statements at various points. The output from these print statements appear in the log files, but only once the script has completed.

                  有什么方法可以确保在脚本运行时输出出现在日志文件中吗?

                  Is there any way to ensure that the output appears in the log file as the script is running?

                  推荐答案

                  并非如此.DBMS_OUTPUT 的工作方式是这样的:您的 PL/SQL 块在数据库服务器上执行,不与客户端交互.因此,当您调用 PUT_LINE 时,它只是将该文本放入服务器内存中的缓冲区中.当您的 PL/SQL 块完成时,控制权返回给客户端(在这种情况下我假设是 SQLPlus);此时,客户端通过调用 GET_LINE 将文本从缓冲区中取出,并显示出来.

                  Not really. The way DBMS_OUTPUT works is this: Your PL/SQL block executes on the database server with no interaction with the client. So when you call PUT_LINE, it is just putting that text into a buffer in memory on the server. When your PL/SQL block completes, control is returned to the client (I'm assuming SQLPlus in this case); at that point the client gets the text out of the buffer by calling GET_LINE, and displays it.

                  因此,让输出更频繁地出现在日志文件中的唯一方法是将一个大的 PL/SQL 块分解为多个较小的块,以便更频繁地将控制权返回给客户端.这可能不切实际,具体取决于您的代码在做什么.

                  So the only way you can make the output appear in the log file more frequently is to break up a large PL/SQL block into multiple smaller blocks, so control is returned to the client more often. This may not be practical depending on what your code is doing.

                  其他替代方法是使用 UTL_FILE 写入文本文件,您可以随时刷新该文件,或者使用自主事务过程将调试语句插入数据库表并在每条语句后提交.

                  Other alternatives are to use UTL_FILE to write to a text file, which can be flushed whenever you like, or use an autonomous-transaction procedure to insert debug statements into a database table and commit after each one.

                  这篇关于有没有办法在 Oracle 中刷新 PL/SQL 的输出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Oracle PL/SQL - Raise User-Defined Exception With Custom SQLERRM(Oracle PL/SQL - 使用自定义 SQLERRM 引发用户定义的异常)
                  Oracle: is there a tool to trace queries, like Profiler for sql server?(Oracle:是否有跟踪查询的工具,例如用于 sql server 的 Profiler?)
                  SELECT INTO using Oracle(使用 Oracle SELECT INTO)
                  How to handle Day Light Saving in Oracle database(如何在 Oracle 数据库中处理夏令时)
                  PL/SQL - Use quot;Listquot; Variable in Where In Clause(PL/SQL - 使用“列表Where In 子句中的变量)
                  Oracle: Import CSV file(Oracle:导入 CSV 文件)
                • <small id='TtAGR'></small><noframes id='TtAGR'>

                    <tbody id='TtAGR'></tbody>

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

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

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