首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > oracle >

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

2012-03-09 
bat文件执行sql脚本现在我用bat文件执行sql脚本发现会弹出cmd窗口,需要手都输入:/后程序才能执行完,如果sq

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 断开 

热点排行
Bad Request.