Так что я продолжаю эту ошибку, и я не знаю, что происходит. Я разобрался, прочитал некоторые вопросы об этой ошибке, и ничего не работает. Я просто хочу, чтобы это было выполнено, чтобы закончить мой проект.Идентификатор ошибки 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;
ОШИБКА: НАЧАТЬ LOWINVENTORY; КОНЕЦ; * ОШИБКИ LINE1: ОР-06550: строка 1, столбец 9: PLS-00201: идентификатор 'LOWINVENTORY' должен быть объявлен ОР-06550: строка 1, column7: PL/SQL: Заявление проигнорирована
EDIT:
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