我正在为我的家庭作业做这个。当我运行它时,我收到错误:
PACKAGE PKG_Q4 Compiled.
Warning: execution completed with warning
PACKAGE BODY PKG_Q4 Compiled.
50/12 PLS-00330: invalid use of type name or subtype name.
我已经调查过了,但我似乎无法找到解决它的方法。它指向这条线:
INTO v_Room_Number, v_Pet_Status, v_Customer_Source_Description, v_Invoice_Total
这是我的代码:
CREATE OR REPLACE PACKAGE BODY PKG_Q4
AS
FUNCTION FN_Q4
(p_First_Name VARCHAR2, p_Last_Name VARCHAR2)
RETURN VARCHAR2
AS
v_Output VARCHAR2(500);
v_Room_Number NUMBER(3,0);
v_Pet_Status CHAR(1);
v_Customer_Source_Description VARCHAR2(30);
v_Invoice_Total NUMBER(7,2);
v_First_Name VARCHAR2(15);
v_Last_Name VARCHAR2(20);
v_Customer_Code CHAR(4);
v_Registration_Status_Code CHAR(1);
BEGIN
SELECT First_Name, Last_Name
INTO v_First_Name, v_Last_Name
FROM Customer
WHERE First_Name = p_First_Name AND
Last_Name = p_Last_Name;
Select Registration_Status_Code
INTO v_Registration_Status_Code
FROM Registration_Status;
IF v_Registration_Status_Code = 'N' THEN
SELECT Room.Room_Number, Room.Pet_Status, Customer_Source.Customer_Source_Description, Invoice.Invoice_Total
INTO v_Room_Number, v_Pet_Status, v_Customer_Source_Description, v_Invoice_Total
FROM Registration , Customer , Customer_Source , Room , Invoice
WHERE Customer.customer_code = Registration.customer_code AND
Customer_Source.customer_source_code = Customer.customer_source_code AND
Room.room_number = Registration.room_number AND
Registration.registration_number = Invoice.registration_number;
v_Output := 'Room Number:' || v_Room_Number ||'Pet Status:' || v_Pet_Status ||
'Customer Source Code:' || v_Customer_Source_Description ||'Total Cost:' || v_Invoice_Total;
END IF;
Return Varchar2;