与DOS批处理文件SQLPLUS命令行 [英] SQLPLUS command line with DOS batch file
本文介绍了与DOS批处理文件SQLPLUS命令行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想创建一个批处理文件,该文件将打开SQLPLUS [CLI],将执行一些存储在SQL文件,也将存储输出到文本文件。
I want to create a batch file which will open the SQLPLUS [CLI] and will execute some stored sql file and will also store the output to text file.
所以我创造了这个批处理文件[不工作。结果
这些SQL文件包含SQL从表中返回的最大数量。
So I've created this batch file [which does not work].
These SQL file contains SQL which returns the max number from a table.
sqlplus scott/tiger@DB
@sql1.sql>data1.txt
@sql2.sql>data2.txt
问题是,它打开后不执行SQL文件SQLPLUS
The problem is it does not executes the SQL files after opening the SQLPLUS
- Windows XP中
- 的Oracle 9i中
推荐答案
有关本机的SQL * Plus后台是什么?
What about native Sql*plus spooling?
的run.bat:
sqlplus hr/hr@sandbox @d:\run.sql
run.sql:
run.sql:
spool d:\run.log
set echo on
select * from dual
/
exit
RUN.LOG:
run.log:
01:50:20 HR@sandbox>
01:50:20 HR@sandbox> select * from dual
01:50:20 2 /
D
-
X
Elapsed: 00:00:00.00
01:50:21 HR@sandbox> exit
这篇关于与DOS批处理文件SQLPLUS命令行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文