Oracle sqlplus 在 windows 批处理中执行 sql 文件

Oracle sqlplus executes sql file in windows batch

我安装了 Sqlplus 并且 运行 下面是 cmd 中的一个批处理文件。

"D:\setups\instantclient_11_2\sqlplus.exe" username/password@"(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=111.111.111.11) (PORT=1521)))(CONNECT_DATA=(SID=orcl)))"  @"E:\sql scripts\procedure.sql"

这就是我得到的。我的程序意味着将记录插入 table 但 table 仍然是空的。

E:\p01-material big data projects\batch>sql.bat

SQL*Plus: Release 11.2.0.4.0 Production on 星期四 1月 25 11:22:29 2018
Copyright (c) 1982, 2013, Oracle.  All rights reserved.

连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
  6

它永远留在这里。 6 在这里可能是因为我的 sql 文件 procedure.sql 有 6 行语句。我怎样才能使这项工作?

谢谢

您 PROCEDURE.SQL 的最后一行应该是正斜杠 /。它显示 SQL*此外,您已经终止了程序并将 运行 它。

或者,当您看到“6”(它是行号;SQL*Plus 等待您输入 something)时,输入 / 并按 "Enter"键盘上的键。