大家帮我看看这个function 哪里出了问题。 谢谢# Database - 数据库
g*i
1 楼
不知道为什麽这个function每次都不执行update语句。 到底错在哪里呢? 真是郁闷。
FUNCTION deposit_checking(
acct_num IN Checking_Accounts.account_num%TYPE,
deposit_amt IN NUMBER,
overdraft OUT NUMBER
)
RETURN NUMBER IS
BEGIN
BEGIN
SELECT distinct a.overdraft_amount, a.balance
into overdraft_amt, cust_balance
from Customers c, Has_Account b, Checking_Accounts a
where c.customer_num = b.customer_num
and b.account_num = a.account_num
and a.account_num=acct_num;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RETURN null;
END
FUNCTION deposit_checking(
acct_num IN Checking_Accounts.account_num%TYPE,
deposit_amt IN NUMBER,
overdraft OUT NUMBER
)
RETURN NUMBER IS
BEGIN
BEGIN
SELECT distinct a.overdraft_amount, a.balance
into overdraft_amt, cust_balance
from Customers c, Has_Account b, Checking_Accounts a
where c.customer_num = b.customer_num
and b.account_num = a.account_num
and a.account_num=acct_num;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RETURN null;
END