<bdo id='SEydo'></bdo><ul id='SEydo'></ul>
<tfoot id='SEydo'></tfoot>

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

      1. <legend id='SEydo'><style id='SEydo'><dir id='SEydo'><q id='SEydo'></q></dir></style></legend>

        <i id='SEydo'><tr id='SEydo'><dt id='SEydo'><q id='SEydo'><span id='SEydo'><b id='SEydo'><form id='SEydo'><ins id='SEydo'></ins><ul id='SEydo'></ul><sub id='SEydo'></sub></form><legend id='SEydo'></legend><bdo id='SEydo'><pre id='SEydo'><center id='SEydo'></center></pre></bdo></b><th id='SEydo'></th></span></q></dt></tr></i><div id='SEydo'><tfoot id='SEydo'></tfoot><dl id='SEydo'><fieldset id='SEydo'></fieldset></dl></div>
      2. 假脱机命令:不将 SQL 语句输出到文件

        时间:2023-09-18
        • <legend id='mdDAs'><style id='mdDAs'><dir id='mdDAs'><q id='mdDAs'></q></dir></style></legend>
            <i id='mdDAs'><tr id='mdDAs'><dt id='mdDAs'><q id='mdDAs'><span id='mdDAs'><b id='mdDAs'><form id='mdDAs'><ins id='mdDAs'></ins><ul id='mdDAs'></ul><sub id='mdDAs'></sub></form><legend id='mdDAs'></legend><bdo id='mdDAs'><pre id='mdDAs'><center id='mdDAs'></center></pre></bdo></b><th id='mdDAs'></th></span></q></dt></tr></i><div id='mdDAs'><tfoot id='mdDAs'></tfoot><dl id='mdDAs'><fieldset id='mdDAs'></fieldset></dl></div>
            <tfoot id='mdDAs'></tfoot>
              <bdo id='mdDAs'></bdo><ul id='mdDAs'></ul>

                <tbody id='mdDAs'></tbody>

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

                1. 本文介绍了假脱机命令:不将 SQL 语句输出到文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想将查询输出到 CSV 文件,并使用以下内容作为小测试;

                  I am wanting to output a Query to a CSV file and am using the below as a small test;

                  spool c:	est.csv 
                  select /*csv*/ username, user_id, created from all_users;
                  spool off;
                  

                  但输出有实际的选择语句作为第一行

                  but the output has the actual select statment as the first line

                  > select /*csv*/ username    user_id     created from all_users
                  USERNAME    USER_ID CREATED
                  REPORT  52  11-Sep-13
                  WEBFOCUS    51  18-Sep-12
                  

                  有没有办法防止这种情况发生?我试过 SET Heading Off 认为可能会这样做,但它没有改变.我正在使用 SQL Developer 作为脚本运行.

                  Is there a way to prevent this? I tried SET Heading Off thinking that might do it, but it did not change. I am using SQL Developer an running as script.

                  谢谢布鲁斯

                  推荐答案

                  不幸的是,SQL Developer 没有完全遵守 set echo off 命令,该命令可以(似乎)在 SQL*Plus 中解决这个问题.

                  Unfortunately SQL Developer doesn't fully honour the set echo off command that would (appear to) solve this in SQL*Plus.

                  我为此找到的唯一解决方法是将您正在执行的操作保存为脚本,例如test.sql 与:

                  The only workaround I've found for this is to save what you're doing as a script, e.g. test.sql with:

                  set echo off
                  spool c:	est.csv 
                  select /*csv*/ username, user_id, created from all_users;
                  spool off;
                  

                  然后在 SQL Developer 中,只需调用该脚本:

                  And then from SQL Developer, only have a call to that script:

                  @test.sql
                  

                  并将其作为脚本运行 (F5).

                  And run that as a script (F5).

                  对于临时查询以外的任何内容,保存为脚本文件应该不会有太大的困难;并使用 @ 运行它而不是打开脚本并直接运行它只是有点痛苦.

                  Saving as a script file shouldn't be much of a hardship anyway for anything other than an ad hoc query; and running that with @ instead of opening the script and running it directly is only a bit of a pain.

                  在SQL 开发者论坛和开发团队上进行了一番搜索,找到了相同的解决方案暗示模仿 SQL*Plus 的行为是有意为之;您还需要在那里运行带有 @ 的脚本以隐藏查询文本.

                  A bit of searching found the same solution on the SQL Developer forum, and the development team suggest it's intentional behaviour to mimic what SQL*Plus does; you need to run a script with @ there too in order to hide the query text.

                  这篇关于假脱机命令:不将 SQL 语句输出到文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:在 oracle11g 中创建参数化视图 下一篇:SQL 错误“ORA-01722:无效数字"

                  相关文章

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

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

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