错误信息
【汉】PLS-00306: 调用“字符串”时参数的数目或类型错误
【英】PLS-00306:wrong number or types of arguments in call to 'string'
【详细报错】ORA-06553:PLS-306:wrong number or types of arguments in call to 'string'
序
在使用call命令执行存储过程时报错。
注意,虽然提示的报错是ORA-06553,但是ORA-06553是PLS类错误,要解决重点是后面的PLS错误代码。
版本
Oracle 【11.2.0.3.0】、【11.2.0.4.0】
故
简单点就是call命令中调用参数的类型错了。
解
call命令中传递正确的参数类型。
演示
我这里简单写一个存储过程,它有一个clob的入参,执行会输出入参的值。写法如下:
create or replace procedure testaaa(
a clob default 'a'
)
as
begin
dbms_output.put_line(a);
end;
我们先使用入参333来测试一下,模拟报错。
call testaaa(a => 333)
再使用正确的入参测试一下。
call testaaa(a => 'hello')
就能完全模拟出该问题出错和出错的原因。
评论区