我必须创建一个过程,插入特定发票的行项目(产品代码)和数量。该程序只能采用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
答案 0 :(得分:2)
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;
/
请注意,您还要向程序传递太多参数......