:我正在尝试从Linux脚本中运行一个Oracle存储过程。我创建了一个名为my_procedure.sql的.sql文件,如下所示:
set serveroutput on
set serveroutput off
DECLARE
my_variable NUMBER(10);
BEGIN
exec schema.my_procedure();
END;
/
EXIT上面的.sql文件依次是从名为myscript.sh的简单shell脚本调用的,如下所示:
sqlplus -s /@connection_sid @my_procedureProblem:当我执行sh myscript.sh时,它会在my_procedure.sql文件中抛出一个错误,如下所示:
Encountered the symbol 'schema' when expecting one of the following
:= . ( @ % ;到目前为止我已经尝试过的:我想-通过删除exec关键字来工作。然后我试着使用username.schema.myprocedure,但是没有任何效果。
此过程在命令行中运行良好,因此:
sqlplus -s username/password <<END
exec myprocedure();
END;任何有关这方面的建议都会很有帮助。
发布于 2019-08-06 10:43:45
这一行:
exec schema.my_procedure();在你的程序中应该是公正的
schema.my_procedure();https://stackoverflow.com/questions/57374139
复制相似问题