隐藏SQL>假脱机文件中的语句 [英] Hide SQL > statements in the spool file

查看:214
本文介绍了隐藏SQL>假脱机文件中的语句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在文件test.txt(假脱机文件)中隐藏"SQL> @ test.sql"和"SQL>假脱机"

I want to hide the "SQL> @test.sql" and "SQL> spool off" in the file test.txt(spool file)

我的步骤

set heading off 
set pages 0 
set trimspool on 
set lines 120 
set feedback off 
set echo off 
set termout off 
spool test.txt
@test.sql
spool off

test.txt

SQL> @test.sql                              
2002452199  2797    9/1/2014    9/30/2014   OO56128665          934 90087318    1   6046
10226342            ##########  0   0                   


SQL> spool off

推荐答案

将sql语句转换为结果的原因是:-

   如果您复制这些sql脚本并直接粘贴到sql提示符下,然后直接执行将得到这样的问题.因此,为避免这种情况,请将所有脚本代码放入一个.sql文件,并通过在"sql命令提示符"或通过从Dos登录sql到Dos提示符"中提供@ filename.sql来执行整个文件.

    If you copy those sql scripts and paste directly on sql prompt,and execute directly will gets the issues like this. So, to avoid this, place all the script code into one .sql file, and execute that entire file by giving @filename.sql in either "sql command prompt" or in "Dos prompt by logging into sql from Dos".

为避免上述问题/问题,请执行以下步骤:-

--------------这是我的spool_test.sql文件代码-------------

--------------here is my spool_test.sql file code -------------

SET echo off
SET feedback off
SET term off
SET pagesize 0
SET linesize 200
SET newpage 0
SET space 0
col name format a120
spool C:\test.txt
@D:\mahesh-plsql-books\spool\test.sql
SPOOL OFF


1)如果在SQL>提示符下执行上述.sql文件,则它不会在"test.txt"中显示sql语句和结果.像->


1) If you execute the above .sql file within SQL> prompt, then it doesn not shows the sql statements along with results in your "test.txt". Like-->

SQL> @D:\mahesh-plsql-books\spool\spool_test2.sql

2)避免在"test.txt"结果中出现"SQL语句"的另一种方法是使用Dos命令提示符(c:>)而不是如图所示的"sql提示符"执行上述.sql文件下面--->

2) The another way to avoid the "SQL Statements" within the results of "test.txt", is executing the above .sql file with in Dos command prompt(c:>) instead of "sql prompt" like shown below--->

C:\>sqlplus scott/tiger @D:\mahesh-plsql-books\spool\spool_test.sql

......然后您的"test.txt"不显示sql语句,也不显示@ test.sql.

......then your "test.txt" does not show the sql statements, as well as @test.sql.

注意:-scott/tiger是我的Oracle用户名/密码

note:- scott/tiger is my oracle's username/password

感谢和问候,
V.Maheswara Raju.

Thanks and Regards,
V.Maheswara Raju.

这篇关于隐藏SQL>假脱机文件中的语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆