我已使用os_command.exec
向Linux shell发送命令。我正在使用Oracle 12c。从Oracle存储过程调用os_command.exec
下面是一个例子代码的正常工作:
select os_command.exec('/home/smucha/app/smucha/product/12.1.0/dbhome_1/bin/sqlldr userid=system/password control=/home/smucha/load_data.cmt')
from dual
我想在存储过程中运行的类似命令。有没有办法做到这一点?
我已经尝试了以下,但它不起作用。我的过程运行没有错误,但没有记录加载。
execute immediate 'select os_command.exec(''/home/smucha/app/smucha/product/12.1.0/dbhome_1/bin/sqlldr userid=system/acorp56k control=/home/smucha/IZ/load_data.cmt'') from dual';
推测'os_command'是一个Java存储过程,带PL/SQL函数包装器?什么数据类型返回?至少显示PL/SQL规范可能会有用。 (它可能是[这一个](http://www.oracle.com/technetwork/database/enterprise-edition/calling-shell-commands-from-plsql-1-1-129519.pdf),所以它返回一个int?) –