gpt4 book ai didi

sql - 为什么在调用该过程时出现ORA-06576?

转载 作者:行者123 更新时间:2023-12-02 10:50:25 26 4
gpt4 key购买 nike

我必须创建一个过程,为特定发票插入行项目(产品代码)和数量。该过程只能采用4个参数-发票x,行项目y,产品代码z和数量w。

create or replace procedure line_item(x in number,
y in number,
z in VARCHAR2,
w in number)
as
begin

insert into lab9_line (inv_number, line_number, p_code,
line_units, line_price, line_total)
values(x, y, z, w, 0, 0);

end;
/

当我调用该函数时:
call procedure LINE_ITEM(6666,1,0666-SA,6,6.66,6.66);

我得到错误:
Error report -
SQL Error: ORA-06576: not a valid function or procedure name
06576. 00000 - "not a valid function or procedure name"
*Cause: Could not find a function (if an INTO clause was present) or
a procedure (if the statement did not have an INTO clause) to
call.
*Action: Change the statement to invoke a function or procedure

最佳答案

EXEC语法的正确应用如下:

EXEC LINE_ITEM(6666,1,'0666-SA',6,6.66,6.66);

或使用匿名PL/SQL块:
BEGIN
LINE_ITEM(6666,1,'0666-SA',6,6.66,6.66);
END;
/

请注意,您还向过程传递了太多参数。

关于sql - 为什么在调用该过程时出现ORA-06576?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33595732/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com