我有一个脚本,我用来建立/删除表,基本上设置整个架构。 谷歌搜索后,我仍然无法弄清楚如何运行存储过程。oracle - 运行存储过程从脚本
脚本是一个.txt文件,我使用Apex SQL Oracle运行它。
如果我只写这行的脚本:
execute procedurename(1); --where 1 is paramter.
您已经请求运行不包含任何可运行 语句的脚本。
我有一个脚本,我用来建立/删除表,基本上设置整个架构。 谷歌搜索后,我仍然无法弄清楚如何运行存储过程。oracle - 运行存储过程从脚本
脚本是一个.txt文件,我使用Apex SQL Oracle运行它。
如果我只写这行的脚本:
execute procedurename(1); --where 1 is paramter.
您已经请求运行不包含任何可运行 语句的脚本。
SQL>create or replace procedure procedurename(p_num number)
as
begin
null;
end;
/
Procedure created.
SQL>execute procedurename(1);
PL/SQL procedure successfully completed.
一切似乎都与甲骨文11
上SQLPLUS确定,所以它必须是一个顶点的事情。
因为执行是sqlplus中陈述,尝试调用使用开始 - 结束PLSQL块的Apex SQL
程序BEGIN
procedurename(1);
END;
/
保存在一个文件proc_call.sql然后调用它在脚本中像
@C:\proc_call.sql
其中C:是样品流路
对于一些信息,请参考下面的链接
https://forums.oracle.com/forums/thread.jspa?threadID=618393
它是一个脚本或存储过程?要在sql * plus中运行脚本(不知道Apex是什么),可以用'@'作为前缀。 '@c:\ TEMP \ your_script.txt'。 – Marc 2012-04-28 23:47:10
@Marc脚本运行良好。我只需要该脚本就可以调用存储过程。是否有意义?你需要更多的细节吗? – TPR 2012-04-28 23:58:40
脚本应该能够通过调用packagename.procname(1);' – Marc 2012-04-28 23:59:41