当前位置: 代码迷 >> Oracle管理 >> bat文件执行sql脚本,该如何处理
  详细解决方案

bat文件执行sql脚本,该如何处理

热度:8   发布时间:2016-04-24 05:53:42.0
bat文件执行sql脚本
现在我用bat文件执行sql脚本发现会弹出cmd窗口,需要手都输入:/后程序才能执行完,

如果sql脚本文件中仅仅只有insert语句,我用exit就可以---程序执行的时候bat文件闪一下就结束了。

但是我的sql脚本语言中还有过程名称,我只能以begin开始end;结束,这样程序好像就不会自动退出。还必须在cmd执行窗口手动的输入/,程序才能够执行完。

有哪位高手知道怎样让程序自动执行结束?谢谢!



------解决方案--------------------
编辑bat文件,在begin开始end;后面加一个‘/'(重启一行)
------解决方案--------------------
PL/SQL 的END;后面,还有COMMIT;语句后面都要换行加'/'
还有别的什么大家补充哈~
------解决方案--------------------
SQL code
d:\>d:\>more test.batsqlplus aaa/aaa @d:\test.sqld:\>more test.sqlselect * from dual;INSERT INTO test(a) VALUES(1);BEGIN   INSERT INTO test(a) VALUES(2);END;/commit;exit;d:\>test.batd:\>sqlplus aaa/aaa @d:\test.sqlSQL*Plus: Release 10.2.0.1.0 - Production on 星期二 9月 9 23:03:07 2008Copyright (c) 1982, 2005, Oracle.  All rights reserved.连接到:Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProductionWith the Partitioning, OLAP and Data Mining optionsD-X已创建 1 行。PL/SQL 过程已成功完成。提交完成。从 Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProductionWith the Partitioning, OLAP and Data Mining options 断开
  相关解决方案