我使用的是Oracle 10g快递版。
这是我的包创建代码:
CREATE OR REPLACE PACKAGE ticketBooking
AS
FUNCTION maxOrderID() RETURN NUMBER;
FUNCTION maxTransactionID() RETURN NUMBER;
PROCEDURE bookOrder(id IN NUMBER, key IN VARCHAR2, fname IN VARCHAR2, lname IN VARCHAR2, age IN NUMBER, address IN VARCHAR2, adate IN VARCHAR2, status OUT NUMBER);
PROCEDURE bookTicket(id IN NUMBER, orderID IN NUMBER, mID IN NUMBER, mRow IN NUMBER, mSeat IN NUMBER, mDate IN VARCHAR2, mTime IN NUMBER);
END ticketBooking;
/
这是警告信息: -
使用编译错误创建的包。
当我删除这两个函数时,我没有收到错误。我做错了什么?
是因为这两个函数没有传递参数吗?我不需要发送任何参数。我该怎么办?
答案 0 :(得分:2)
不要使用零参数函数的括号。
试试这个:
create or replace PACKAGE ticketBooking
AS
FUNCTION maxOrderID RETURN NUMBER;
FUNCTION maxTransactionID RETURN NUMBER;
PROCEDURE bookOrder(id IN NUMBER, key IN VARCHAR2, fname IN VARCHAR2, lname IN VARCHAR2, age IN NUMBER, address IN VARCHAR2, adate IN VARCHAR2, status OUT NUMBER);
PROCEDURE bookTicket(id IN NUMBER, orderID IN NUMBER, mID IN NUMBER, mRow IN NUMBER, mSeat IN NUMBER, mDate IN VARCHAR2, mTime IN NUMBER);
END ticketBooking;
/