1
标题说明了一切,我一直试图通过PowerShell执行SQL Oracle脚本,但它不起作用。我没有得到一个错误,它只是在右下角说'运行脚本/选择'。不过,我认为它不能正确连接到Oracle。如何通过Powershell执行SQL Oracle脚本(创建表)
请看到的.ps1文件中的代码:
sqlplus Username\Password "@C:\Users\...\script1.sql"
在SQL脚本中有:
CREATE TABLE DEPT
(
DEPTNO VARCHAR2(20)
, DNAME VARCHAR2(20)
, LOC VARCHAR2(20)
);
这里提到的链接清楚地解释了一切。只是随它而动。 https://www.simple-talk.com/sql/sql-tools/using-powershell-to-generate-table-creation-scripts/ – XING
这个网站上有很多类似的问题。你见过这些问题,http://stackoverflow.com/questions/9627225/execute-sqlplus-from-powershell,http://stackoverflow.com/questions/24682465/how-to-run-a-sql-plus- script-in-powershell –
我以前看过这些链接,但是感谢您发表:我后来发现的解决方案是:'sqlplus -s database/password @ $ pathtoscript' –