-1
所以我一直有這個錯誤,而且我對於發生了什麼事情一無所知。我搜索了一下,閱讀了關於這個錯誤的一些問題,並沒有任何工作。我只是想讓它運行,這樣我就可以完成我的項目。錯誤必須聲明PLS-00201標識符
create or replace procedure LOWINVENTORY is
--Variables
ID number;
itemNamed char(15);
description char(20);
startQty number;
--Define inventory item cursor
cursor nextItem is
select inventory.itemID, inventory.itemName, inventory.description, inventory.startQty;
from inventory
where inventory.startQty < 5;
begin
open nextItem;
fetch netxtItem into ID, itemNamed, description, startQty;
if nextItem%notfound then
dbms_output.put_line('No items in need of reordering.');
else
dbms_output.put_line('*********************');
dbms_output.put_line('++Inventory Report++');
dbms_output.put_line('*********************');
dbms_output.put_line('Item Name---ID------Description----------Quantity');
loop
dbms_output.put_line(itemNamed||'-'||ID||'-'||description||'-'||startQty);
fetch netxtItem into ID, itemNamed, description, startQty;
if nextItem%notfound then
dbms_output.put_line('************END REPORT*************');
exit when nextItem%notfound;
end loop;
end lowInventory;
錯誤: BEGIN LOWINVENTORY;結束;在第1行 * ERROR: ORA-06550:第1行,第9欄: PLS-00201:標識符 'LOWINVENTORY' 必須被聲明 ORA-06550:第1行,column7: PL/SQL:語句忽略
編輯:
INSERT INTO inventory(itemID, itemLocation, itemName, description, typicalPrice, startQty)
VALUES(24548576, 'toolbox1', 'wrench', 'turns bolts', 14.00, 6);
INSERT INTO inventory(itemID, itemLocation, itemName, description, typicalPrice, startQty)
VALUES(83742345, 'toolbox1', 'pliers', 'grabs stuff', 11.00, 4);
INSERT INTO inventory(itemID, itemLocation, itemName, description, typicalPrice, startQty)
VALUES(39287426, 'chest2', 'jigsaw', 'cuts stuff', 28.00, 3);
INSERT INTO inventory(itemID, itemLocation, itemName, description, typicalPrice, startQty)
VALUES(48927349, 'chest1', 'blowtorch', 'torches stuff', 330.00, 2);
INSERT INTO inventory(itemID, itemLocation, itemName, description, typicalPrice, startQty)
VALUES(85463455, 'bench3', 'oil filter', 'filters stuff', 16.00, 20);
創建表:
create table inventory
(
itemID number(8) not null primary key constraint lengthCHK8 check(length(itemID)=8),
itemLocation varchar2(10),
itemName varchar2(12) not null,
description varchar2(20),
typicalPrice decimal(7,2) not null constraint notNeg2 check(typicalPrice >=0),
startQty number(4) not null constraint notNeg5 check(startQty >=0)
);
哇,感謝這麼多的數據。如果可以的話,我會給你買一瓶啤酒。然後,我的Oracle帳戶必須發生一些奇怪的事情。我做了更正,我得到了同樣的錯誤。我正在使用命令「exec LOWINVENTORY」並嘗試「exec lowInventory」,它們都與上面的錯誤一樣。 –
您可以發表表格結構和樣本數據,以便我可以模擬嗎? – anudeepks
我已插入示例數據,並運行該過程,請參閱第ouptut的編輯部分 – anudeepks