EXECUTE识别存储过程,CALL不能识别 [英] EXECUTE recognizes a stored procedure, CALL does not

查看:79
本文介绍了EXECUTE识别存储过程,CALL不能识别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试使用EXECUTE运行存储过程时,该proc运行正常.当我使用CALL时,得到"ORA-06576: not a valid function or procedure name".我直接通过蟾蜍连接.为什么我不能使用通话?

When I try to run a stored procedure using EXECUTE, the proc runs fine. When I use CALL, I get "ORA-06576: not a valid function or procedure name". I am connecting directly via toad. Why can't I use call?

我已经尝试了这两个电话:

I have tried both of these Calls:

CALL(BPMS_OWNER.DAILY_PARTITION_NOROTATE('MIP_TEST',5,5,'MIP_TEST_',5,FALSE,TRUE));
CALL BPMS_OWNER.DAILY_PARTITION_NOROTATE('MIP_TEST',5,5,'MIP_TEST_',5,FALSE,TRUE);

我需要使用CALL的原因是我们的平台在将SQL发送给Oracle之前先对其进行了分析,而无论出于何种原因,SQL都不支持EXECUTE.

The reason I need to use CALL is that our platform parses SQL before we send it to Oracle, which for whatever reason does not support EXECUTE.

推荐答案

仅因为 call 要求添加括号,例如call my_proc()

Simply because call requires that you add parenthesis, for instance, call my_proc()

如果我进行一些测试:

SQL>
SQL> create or replace procedure test is
  2  begin
  3     dbms_output.put_line('hi');
  4  end;
  5  /

Procedure created.

以几种不同的方式运行

SQL> exec test
hi

PL/SQL procedure successfully completed.

SQL> call test;
call test
     *
ERROR at line 1:
ORA-06576: not a valid function or procedure name


SQL> call test();
hi

Call completed.

为什么需要使用call? execexecutebegin ... end还不够吗?

Why do you need to use call? Isn't exec, execute and begin ... end enough?

根据您的更新,问题是布尔值,call似乎不支持.创建另一个小程序

Based on your update the problem is the booleans, which call doesn't seem to support. Creating yet another small procedure

SQL> create or replace procedure test (Pbool boolean ) is
  2  begin
  3     if Pbool then
  4        dbms_output.put_line('true');
  5     else
  6        dbms_output.put_line('false');
  7     end if;
  8  end;
  9  /

Procedure created.

SQL> show error
No errors.

运行它证明了这一点

SQL> call test(true);
call test(true)
          *
ERROR at line 1:
ORA-06576: not a valid function or procedure name

我不太理解您为什么不能使用execexecute的原因,但是假设这两个都是不可行的,为什么不只使用传统的匿名PL/SQL块呢?

I don't quite understand your reasoning behind why you can't use exec or execute but assuming these are both off limits why not just use a traditional, anonymous PL/SQL block?

SQL> begin
  2     test(true);
  3  end;
  4  /
true

PL/SQL procedure successfully completed.

这篇关于EXECUTE识别存储过程,CALL不能识别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆