PLSQL从.shl脚本将参数传递给.sql文件

时间:2018-03-19 17:18:34

标签: sql shell plsql

我正在尝试运行带有值的shell脚本,并将这些值传递给.sql文件,该文件将使用这些值调用我的plsql过程。我已经尝试了很多但没有运气。

我现在拥有的:

shl script: RunSql $SQL_PATH/update_load_status.sql 'N'
sql script: execute dbms_output.put_line('&1'); (based on other code in system - (&1) gives a bind var not declared)

多个值会以类似的方式工作吗?

谢谢!

1 个答案:

答案 0 :(得分:0)

使用DEFINE关键字捕获传递给shell脚本的参数

define first_arg=&1
define second_arg=&2

BEGIN
    dbms_output.put_line('&first_arg');
    dbms_output.put_line('&second_arg');
END;
/
相关问题