我使用了我的笔记/W3schools 和 Google,但找不到问题。当我运行该过程时,我收到以下消息:
警告 程序创建时出现编译错误
我创建了一个基于划船俱乐部的数据库,并且所有表格都可以正常工作。成功执行内部连接、立方体等。
我正在尝试运行以下过程:
CREATE OR REPLACE PROCEDURE totalCost (boatName IN NVARCHAR2)
IS
total NUMBER;
boatCost NUMBER;
numPeople NUMBER;
BEGIN
SELECT COST INTO boatCost FROM Races WHERE winning_boat = 'IronPrice';
SELECT boat_size INTO numPeople FROM Boat_size WHERE winning_boat = 'IronPrice';
total:=boatCost*numPeople;
DBMS_OUTPUT.PUT_LINE('The total cost for this boat is '||total);
END totalCost;
/
CREATE TABLE Boats (
Boat_Name VARCHAR (20),
Boat_size Number (5),
Fname VARCHAR (20),
Riggin_Style VARCHAR (10),
Price Number (20),
Register_plate VARCHAR (20),
Primary Key(Boat_Name),
FOREIGN KEY (Register_plate) REFERENCES TRAILERS(Register_plate),
FOREIGN KEY (Fname) REFERENCES Coaches(Fname));
CREATE TABLE RACES (
Location VARCHAR (20),
Style VARCHAR (20),
Cost Number(5),
Season VARCHAR (10),
Winning_Club VARCHAR (20),
Winning_Boat VARCHAR (20),
Primary Key(Location))