扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
bat文件执行sql脚本
现在我用bat文件执行sql脚本发现会弹出cmd窗口,需要手都输入:/后程序才能执行完,
如果sql脚本文件中仅仅只有insert语句,我用exit就可以---程序执行的时候bat文件闪一下就结束了。
但是我的sql脚本语言中还有过程名称,我只能以begin开始end;结束,这样程序好像就不会自动退出。还必须在cmd执行窗口手动的输入/,程序才能够执行完。
怎样让程序自动执行结束?
SQL code
d:\>
d:\>more test.bat
sqlplus aaa/aaa @d:\test.sql
d:\>more test.sql
select * from dual;
INSERT INTO test(a) VALUES(1);
BEGIN
INSERT INTO test(a) VALUES(2);
END;
/
commit;
exit;
d:\>test.bat
d:\>sqlplus aaa/aaa @d:\test.sql
SQL*Plus: Release 10.2.0.1.0 - Production on 星期二 9月 9 23:03:07 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
D
-
X
已创建 1 行。
PL/SQL 过程已成功完成。
提交完成。
从 Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options 断开
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。