嗨,这是我的第一篇文章,如果之前有人问过,很抱歉。我正在尝试创建一个程序,该程序将为存款账户(针对特定银行)增加利息,并将客户姓名和存款账户的新余额输出到屏幕上。但我似乎无法让它工作。
CREATE OR REPLACE PROCEDURE addInterestNew(bank VARCHAR, interestRate INT out) AS
CURSOR CustomerBalance IS
SELECT customerName, balance
FROM Deposit
WHERE branchName = bank;
aCustomerName Deposit.customerName%TYPE;
newBalance Deposit.balance%TYPE
BEGIN
UPDATE DEPOSIT
SET balance = balance * (1 + (interestRate/100))
WHERE branchName = bank;
FETCH
OPEN CustomerBalance;
LOOP
FETCH CustomerBalance into aCustomerName,newbalance;
EXIT WHEN CustomerBalance%notfound;
dbms_output.put_line('CustomerName='||aCustomerName ||'balance='||newBalance);
END LOOP;
CLOSE CustomerBalance;
END;
/
任何帮助表示赞赏
谢谢