我创建了以下过程,以按项 ID 从所有项目表中删除项目,但是程序不像我想要的那样有效。它删除所有项目。
procedure DeleteItem(itemid in number) is
begin
delete from allitems where itemid=itemdid;
commit;
end;
我知道
有严格的命名标准并不时髦,但老实说,它们会有所帮助。以"p_"为前缀命名参数,以便代码变为;
create or replace procedure DeleteItem(itemid_in in number) is
begin
delete from allitems where itemid = itemid_in;
commit;
end;
我可能不同意所有这些,但看看史蒂文·费尔斯坦对此的看法——https://community.oracle.com/servlet/JiveServlet/downloadBody/1007838-102-1-144760/PLSQL%20Naming%20Conventions%20and%20Coding%20Standards.pdf