I have the following procedure, which is supposed to delete a specific customer.
(我有以下步骤,应该删除特定的客户。)
I keep getting errors, and I am not sure why. (我不断收到错误,我不确定为什么。)
I am new to this and this is a class homework. (我是新来的,这是课堂作业。)
Thanks in advance for your help:
(在此先感谢您的帮助:)
CREATE or REPLACE PROCEDURE DISP_CUST_DELETE (I_CUSTOMER_NUM IN CUSTOMER_NUM&TYPE)
BEGIN
DELETE
FROM CUSTOMER
WHERE CUSTOMER_NUM = I_CUSTOMER_NUM;
dbms_output.put_line('Customer has been deleted');
EXCEPTION
WHEN NO_DATA_FOUND THEN
dbms_output.put_line('NO CUSTOMER WITH this number has been deleted');
END;
/
Here is a little update.
(这是一个小更新。)
Yes, sorry that is what I meant.
(是的,对不起,这就是我的意思。)
Here is the updated procedure. (这是更新的过程。)
CREATE or REPLACE PROCEDURE DISP_CUST_DELETE (I_CUSTOMER_NUM IN CUSTOMER.CUSTOMER_NUM) AS
BEGIN
DELETE
FROM CUSTOMER
WHERE CUSTOMER_NUM = I_CUSTOMER_NUM;
dbms_output.put_line('Customer' || I_CUSTOMER_NUM ||'has been deleted');
EXCEPTION
WHEN NO_DATA_FOUND THEN
dbms_output.put_line('NO CUSTOMER WITH'||I_CUSTOMER_NUM||'has been deleted');
END;
/
And here is the error I am getting:
(这是我得到的错误:)
0/0 PL/SQL: Compilation unit analysis terminated 1/47
(0/0 PL / SQL:编译单元分析已终止1/47)
PLS-00488: 'CUSTOMER.CUSTOMER_NUM' must be a type
(PLS-00488:“ CUSTOMER.CUSTOMER_NUM”必须为类型)
ask by Alan translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…