Hi All,
I have a new problem & struggling to get solution.
I have a form which looks like below created in Oracle Forms Builder 6i from table name RECEIVED_FORM_15G. This table is empty in Database.
Acct_Fd_No | Form_15g | Pan No | Received_15g | Financial_Year | FD_Amount | Acct_Opn_Dt | Maturity_Dt |
---|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
But Cust_Code, Acct_Fd_No, FD_Amount, Acct_Opn_Dt, Maturity_Dt is present in another table named as KEC_FDACCT_MSTR.
So when the user enter the Cust_code, i want all the above said fields to display.
For that i put in the following code for trigger KEY-NEXT-ITEM for Cust_Code:
DECLARE
FD_NO NUMBER;
FD_AMT NUMBER;
OPN_DT DATE;
MAT_DT DATE;
BEGIN
SELECT ACCT_FD_NO, AMOUNT, ACCT_OPN_DT, MATURITY_DATE INTO FD_NO, FD_AMT, OPN_DT, MAT_DT
FROM KEC_FDACCT_MSTR WHERE ACCT_CUST_CODE = :CUST_CODE;
:ACCT_FD_NO := FD_NO;
:FD_AMOUNT := FD_AMT;
:ACCT_OPN_DATE:= OPN_DT;
:MATURITY_DATE:= MAT_DT;
END;
This works fine if a Cust_Code has only one Acct_Fd_No like below.
Acct_Fd_No | Form_15g | Pan No | Received_15g | Financial_Year | FD_Amount | Acct_Opn_Dt | Maturity_Dt |
---|
330340 | | | | | 500000 | 14-JAN-2011 | 13-JAN-2014 |
| | | | | | | |
|
But when Cust_Code has more than one Acct_Fd_No , it throws an error :FRM-40735: KEY-NEXT-ITEM trigger raised unhandled exception ORA-01422.
I know the error because it returns more than one row.
So how can i store multiple rows in one variable ??
I just want to display all the Acct_Fd_No's in the field , when i enter the Cust_Code , for that particular Cust_Code like below.
For example, Cust_Code=124 has 3 Acct_Fd_No (33738, 33765, 33872).
So after i enter the Cust_Code & i want to display like the following:
Acct_Fd_No | Form_15g | Pan No | Received_15g | Financial_Year | FD_Amount | Acct_Opn_Dt | Maturity_Dt |
---|
33738 | | | | | 50000 | 14-JAN-2010 | 13-JAN-2013 |
33765 | | | | | 1000000 | 3-MAR-2011 | 2-MAR-2014 |
33872 | | | | | 150000 | 30-APR-2012 | 29-APR-2014 |
|
So how do i do this??