Redian新闻
>
大家帮我看看这个function 哪里出了问题。 谢谢
avatar
大家帮我看看这个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
avatar
a*c
2
Questions for you:
1. Is this function created successfully? Cause you didn't define two
variables used in the script.
2. Why do you join three tables together to get out the distinct overdraft_amt
and bal, not directly from Checking_Accounts table?
3. Acct_num in the Checking_Accounts table is unique (primary key)? I think
you need double check the SELECT DISTINCT ... FROM ... WHERE and make sure no
multiple rows returned or other exceptions are raised.
I looks to me that your function exit in

【在 g**i 的大作中提到】
: 不知道为什麽这个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

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。