oracle – EXECUTE识别存储过程,CALL不识别

前端之家收集整理的这篇文章主要介绍了oracle – EXECUTE识别存储过程,CALL不识别前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
当我尝试使用EXECUTE运行存储过程时,proc运行正常.当我使用CALL时,我得到“ORA-06576:不是有效的函数或过程名称”.我通过蟾蜍直接连接.为什么我不能使用电话?

我试过这两个电话:

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

我需要使用CALL的原因是我们的平台在将它发送给Oracle之前解析sql,无论出于何种原因,它都不支持EXECUTE.

解决方法

仅仅因为 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.

你为什么需要使用电话?不是执行,执行和开始……结束吗?

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

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

我不太明白为什么你不能使用exec或执行,但假设这些都是禁止的,为什么不使用传统的匿名PL / sql块?

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

PL/sql procedure successfully completed.

猜你在找的Oracle相关文章